Add Missing Context Menu Icons
This commit is contained in:
parent
3887561047
commit
6c27b39576
31 changed files with 216 additions and 126 deletions
|
|
@ -1282,3 +1282,101 @@ export function TopRightArrow(props: IconProps) {
|
|||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function CheckmarkLargeBoldIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M21.7 5.3a1 1 0 0 1 0 1.4l-12 12a1 1 0 0 1-1.4 0l-6-6a1 1 0 1 1 1.4-1.4L9 16.58l11.3-11.3a1 1 0 0 1 1.4 0Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function XLargeBoldIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M18.94 21.06a1.5 1.5 0 1 0 2.12-2.12L14.12 12l6.94-6.94a1.5 1.5 0 1 0-2.12-2.12L12 9.88 5.06 2.94a1.5 1.5 0 1 0-2.12 2.12L9.88 12l-6.94 6.94a1.5 1.5 0 1 0 2.12 2.12L12 14.12l6.94 6.94Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function UnsendIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M3 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 0-2H5.07a8 8 0 1 1 13.29 8.86l-.01.01a7.97 7.97 0 0 1-1.9 1.78 1 1 0 0 0 1.1 1.67c.19-.12.36-.25.53-.38.7-.54 1.32-1.16 1.85-1.85l.01-.01A9.95 9.95 0 0 0 22 12 10 10 0 0 0 4 6V3a1 1 0 0 0-1-1ZM3.18 14.06a1 1 0 0 0-.61 1.27c.11.33.24.64.4.95a1 1 0 0 0 1.8-.86c-.12-.24-.22-.5-.32-.75a1 1 0 0 0-1.27-.61ZM5.33 18.12a1 1 0 0 0 .09 1.41c.51.45 1.07.85 1.67 1.18a1 1 0 0 0 .98-1.74 8.02 8.02 0 0 1-1.33-.95 1 1 0 0 0-1.41.1ZM14.17 20.8a1 1 0 0 0-1.12-.87 8.08 8.08 0 0 1-1.87.03 1 1 0 1 0-.2 1.99 10.1 10.1 0 0 0 2.32-.03 1 1 0 0 0 .87-1.13Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function WindowTopOutlineIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M4 5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v.18a1 1 0 1 0 2 0V5a3 3 0 0 0-3-3H5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h.18a1 1 0 1 0 0-2H5a1 1 0 0 1-1-1V5Z"
|
||||
/>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M8 11a3 3 0 0 1 3-3h8a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-8a3 3 0 0 1-3-3v-8Zm2 0a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function BookCheckIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M15 2a3 3 0 0 1 3 3v12H5.5a1.5 1.5 0 0 0 0 3h14a.5.5 0 0 0 .5-.5V5h1a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H5a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3h10Zm-.3 5.7a1 1 0 0 0-1.4-1.4L9 10.58l-2.3-2.3a1 1 0 0 0-1.4 1.42l3 3a1 1 0 0 0 1.4 0l5-5Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function TrashIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M14.25 1c.41 0 .75.34.75.75V3h5.25c.41 0 .75.34.75.75v.5c0 .41-.34.75-.75.75H3.75A.75.75 0 0 1 3 4.25v-.5c0-.41.34-.75.75-.75H9V1.75c0-.41.34-.75.75-.75h4.5Z"
|
||||
/>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M5.06 7a1 1 0 0 0-1 1.06l.76 12.13a3 3 0 0 0 3 2.81h8.36a3 3 0 0 0 3-2.81l.75-12.13a1 1 0 0 0-1-1.06H5.07ZM11 12a1 1 0 1 0-2 0v6a1 1 0 1 0 2 0v-6Zm3-1a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,14 +24,28 @@ interface IMessageCreate {
|
|||
|
||||
const SILENT_PING_FLAG = 1 << 12;
|
||||
|
||||
function Icon(enabled?: boolean): JSX.Element {
|
||||
return <svg
|
||||
width="18"
|
||||
height="18"
|
||||
>
|
||||
<circle cx="9" cy="9" r="8" fill={!enabled ? "var(--status-danger)" : "currentColor"} />
|
||||
<circle cx="9" cy="9" r="3.75" fill={!enabled ? "white" : "black"} />
|
||||
</svg>;
|
||||
function DisabledIcon(): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
>
|
||||
<circle cx="9" cy="9" r="8" fill="var(--status-danger)" />
|
||||
<circle cx="9" cy="9" r="3.75" fill="white" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function EnabledIcon(): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
>
|
||||
<circle cx="9" cy="9" r="8" fill="currentColor" />
|
||||
<circle cx="9" cy="9" r="3.75" fill="black" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function processIds(value: string): string {
|
||||
|
|
@ -80,7 +94,8 @@ function ContextCallback(name: "guild" | "user" | "channel"): NavContextMenuPatc
|
|||
<Menu.MenuItem
|
||||
id={`status-${name}-bypass`}
|
||||
label={`${enabled ? "Remove" : "Add"} Status Bypass`}
|
||||
icon={() => Icon(enabled)}
|
||||
icon={enabled ? EnabledIcon : DisabledIcon}
|
||||
leadingAccessory={{ type: "icon", icon: enabled ? EnabledIcon : DisabledIcon }}
|
||||
action={() => {
|
||||
let bypasses: string[] = settings.store[`${name}s`].split(", ");
|
||||
if (enabled) bypasses = bypasses.filter(id => id !== type.id);
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
*/
|
||||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, getDiscordFolderIcon, isBookmarkFolder, isTabSelected, navigateToBookmark, openedTabs, settings, switchChannel, UseBookmarkMethods, useBookmarks } from "@equicordplugins/channelTabs/util";
|
||||
import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, getDiscordFolderIcon, isBookmarkFolder, isTabSelected, navigateToBookmark, openedTabs, settings, UseBookmarkMethods, useBookmarks } from "@equicordplugins/channelTabs/util";
|
||||
import { CircleQuestionIcon, DiscoveryIcon, EnvelopeIcon, FriendsIcon, NitroIcon, QuestIcon, ShopIcon } from "@equicordplugins/channelTabs/util/icons";
|
||||
import { classNameFactory } from "@utils/css";
|
||||
import { getGuildAcronym, getIntlMessage } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { Avatar, ChannelStore, closeModal, ContextMenuApi, FluxDispatcher, GuildStore, Menu, openModal,React, ReadStateStore, ReadStateUtils, SelectedChannelStore, SelectedGuildStore, TextInput, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore, useState } from "@webpack/common";
|
||||
import { Avatar, ChannelStore, closeModal, ContextMenuApi, FluxDispatcher, GuildStore, Menu, openModal, React, ReadStateStore, ReadStateUtils, SelectedChannelStore, SelectedGuildStore, TextInput, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore, useState } from "@webpack/common";
|
||||
|
||||
import { NotificationDot } from "./ChannelTab";
|
||||
import { BookmarkContextMenu, EditModal } from "./ContextMenus";
|
||||
|
|
@ -123,100 +123,6 @@ function BookmarkIcon({ bookmark }: { bookmark: Bookmark | BookmarkFolder; }) {
|
|||
);
|
||||
}
|
||||
|
||||
function BookmarkFolderOpenMenu(props: BookmarkProps) {
|
||||
const { bookmarks, index, methods } = props;
|
||||
const bookmark = bookmarks[index] as BookmarkFolder;
|
||||
const { bookmarkNotificationDot } = settings.use(["bookmarkNotificationDot"]);
|
||||
|
||||
return (
|
||||
<Menu.Menu
|
||||
navId="bookmark-folder-menu"
|
||||
onClose={() => FluxDispatcher.dispatch({ type: "CONTEXT_MENU_CLOSE" })}
|
||||
aria-label="Bookmark Folder Menu"
|
||||
>
|
||||
{bookmark.bookmarks.map((b, i) => (
|
||||
<Menu.MenuItem
|
||||
key={`bookmark-folder-entry-${b.channelId}`}
|
||||
id={`bookmark-folder-entry-${b.channelId}`}
|
||||
label={
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "0.25rem"
|
||||
}}>
|
||||
<span
|
||||
style={{
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis"
|
||||
}}>
|
||||
{b.name}
|
||||
</span>
|
||||
{bookmarkNotificationDot && <NotificationDot channelIds={[b.channelId]} />}
|
||||
</div>
|
||||
}
|
||||
icon={() => <BookmarkIcon bookmark={b} />}
|
||||
showIconFirst={true}
|
||||
action={() => switchChannel(b)}
|
||||
>
|
||||
{bookmarkNotificationDot && (
|
||||
<Menu.MenuGroup>
|
||||
<Menu.MenuItem
|
||||
key="mark-as-read"
|
||||
id="mark-as-read"
|
||||
label={getIntlMessage("MARK_AS_READ")}
|
||||
disabled={!ReadStateStore.hasUnread(b.channelId)}
|
||||
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(b.channelId))}
|
||||
/>
|
||||
</Menu.MenuGroup>
|
||||
)}
|
||||
<Menu.MenuGroup key="bookmarks">
|
||||
<Menu.MenuItem
|
||||
key="edit-bookmark"
|
||||
id="edit-bookmark"
|
||||
label="Edit Bookmark"
|
||||
action={() => {
|
||||
const key = openModal(modalProps =>
|
||||
<EditModal
|
||||
modalProps={modalProps}
|
||||
modalKey={key}
|
||||
bookmark={b}
|
||||
onSave={name => {
|
||||
const newBookmarks = [...bookmark.bookmarks];
|
||||
newBookmarks[i].name = name;
|
||||
methods.editBookmark(index, { bookmarks: newBookmarks });
|
||||
closeModal(key);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
key="delete-bookmark"
|
||||
id="delete-bookmark"
|
||||
label="Delete Bookmark"
|
||||
action={() => {
|
||||
methods.deleteBookmark(i, index);
|
||||
}}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
key="remove-bookmark-from-folder"
|
||||
id="remove-bookmark-from-folder"
|
||||
label="Remove Bookmark from Folder"
|
||||
action={() => {
|
||||
const newBookmarks = [...bookmark.bookmarks];
|
||||
newBookmarks.splice(i, 1);
|
||||
methods.addBookmark(b);
|
||||
methods.editBookmark(index, { bookmarks: newBookmarks });
|
||||
}}
|
||||
/>
|
||||
</Menu.MenuGroup>
|
||||
</Menu.MenuItem>
|
||||
))}
|
||||
</Menu.Menu>
|
||||
);
|
||||
}
|
||||
|
||||
function FolderBookmarkItem({ bookmark, bookmarks, folderIndex, bookmarkIndex, methods, isCurrentChannel, searchActive }: {
|
||||
bookmark: Bookmark;
|
||||
bookmarks: (Bookmark | BookmarkFolder)[];
|
||||
|
|
@ -476,13 +382,11 @@ function Bookmark(props: BookmarkProps & { isExpanded?: boolean; onToggleFolder?
|
|||
if (item.isFromFolder) {
|
||||
// coming from a folder
|
||||
methods.deleteBookmark(item.index, item.folderIndex);
|
||||
methods.addBookmark(sourceBookmark, index);
|
||||
} else {
|
||||
// coming from bar level
|
||||
methods.deleteBookmark(item.index);
|
||||
methods.addBookmark(sourceBookmark, item.index < index ? index - 1 : index);
|
||||
}
|
||||
|
||||
// add to this folder
|
||||
methods.addBookmark(sourceBookmark, index);
|
||||
}
|
||||
},
|
||||
collect: monitor => ({
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { ChannelTabsProps, closeTab, ensureUnreadFallbackCountsLoaded, getNotifi
|
|||
import { ActivityIcon, CircleQuestionIcon, DiscoveryIcon, EnvelopeIcon, FriendsIcon, ICYMIIcon, NitroIcon, QuestIcon, ShopIcon } from "@equicordplugins/channelTabs/util/icons";
|
||||
import { getActiveAutoCompletes } from "@equicordplugins/questify/utils/completion";
|
||||
import { classNameFactory } from "@utils/css";
|
||||
import { getGuildAcronym, getIntlMessage, getUniqueUsername } from "@utils/discord";
|
||||
import { getGuildAcronym, getIntlMessage } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import { Channel, Guild, User } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy, findCssClassesLazy } from "@webpack";
|
||||
|
|
@ -174,9 +174,8 @@ function ChannelTabContent(props: ChannelTabsProps & {
|
|||
const userId = UserStore.getCurrentUser()?.id;
|
||||
const recipients = channel?.recipients;
|
||||
const {
|
||||
noPomeloNames,
|
||||
showStatusIndicators
|
||||
} = settings.use(["noPomeloNames", "showStatusIndicators"]);
|
||||
} = settings.use(["showStatusIndicators"]);
|
||||
|
||||
const [isTyping, status, isMobile] = useStateFromStores(
|
||||
[TypingStore, PresenceStore],
|
||||
|
|
@ -233,9 +232,7 @@ function ChannelTabContent(props: ChannelTabsProps & {
|
|||
if (channel && recipients?.length) {
|
||||
if (recipients.length === 1) {
|
||||
const user = UserStore.getUser(recipients[0]) as User & { globalName: string; };
|
||||
const username = noPomeloNames
|
||||
? user.globalName || user.username
|
||||
: getUniqueUsername(user);
|
||||
const username = user.globalName || user.username;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { BookCheckIcon, OpenExternalIcon, PencilIcon, StarFilled, StarOutlined, TrashIcon, UnsendIcon, WindowTopOutlineIcon, XLargeBoldIcon } from "@components/Icons";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { bookmarkFolderColors, bookmarkPlaceholderName, closeOtherTabs, closeTab, closeTabsToTheLeft, closeTabsToTheRight, createTab, getDiscordFolderIcon, getDiscordFolderIconNames, hasClosedTabs, isBookmarkFolder, openedTabs, reopenClosedTab, settings, toggleCompactTab } from "@equicordplugins/channelTabs/util";
|
||||
import { Bookmark, BookmarkFolder, Bookmarks, ChannelTabsProps, UseBookmarkMethods } from "@equicordplugins/channelTabs/util/types";
|
||||
|
|
@ -415,6 +416,8 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
|||
{bookmarkNotificationDot && !isFolder &&
|
||||
<Menu.MenuItem
|
||||
id="mark-as-read"
|
||||
icon={BookCheckIcon}
|
||||
leadingAccessory={{ type: "icon", icon: BookCheckIcon }}
|
||||
label={getIntlMessage("MARK_AS_READ")}
|
||||
disabled={!ReadStateStore.hasUnread(bookmark.channelId)}
|
||||
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(bookmark.channelId))}
|
||||
|
|
@ -424,11 +427,15 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
|||
? <Menu.MenuItem
|
||||
id="open-all-in-folder"
|
||||
label={"Open All Bookmarks"}
|
||||
icon={StarFilled}
|
||||
leadingAccessory={{ type: "icon", icon: StarFilled }}
|
||||
action={() => bookmark.bookmarks.forEach(b => createTab(b))}
|
||||
/>
|
||||
: < Menu.MenuItem
|
||||
id="open-in-tab"
|
||||
label={"Open in New Tab"}
|
||||
icon={OpenExternalIcon}
|
||||
leadingAccessory={{ type: "icon", icon: OpenExternalIcon }}
|
||||
action={() => createTab(bookmark)}
|
||||
/>
|
||||
}
|
||||
|
|
@ -437,6 +444,8 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
|||
<Menu.MenuItem
|
||||
id="edit-bookmark"
|
||||
label="Edit Bookmark"
|
||||
icon={PencilIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PencilIcon }}
|
||||
action={() => {
|
||||
const key = openModal(modalProps =>
|
||||
<EditModal
|
||||
|
|
@ -458,6 +467,8 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
|||
<Menu.MenuItem
|
||||
id="delete-bookmark"
|
||||
label="Delete Bookmark"
|
||||
icon={TrashIcon}
|
||||
leadingAccessory={{ type: "icon", icon: TrashIcon }}
|
||||
action={() => {
|
||||
if (isFolder) {
|
||||
const key = openModal(modalProps =>
|
||||
|
|
@ -476,6 +487,8 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
|||
<Menu.MenuItem
|
||||
id="add-to-folder"
|
||||
label="Add Bookmark to Folder"
|
||||
icon={PencilIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PencilIcon }}
|
||||
disabled={isFolder}
|
||||
action={() => {
|
||||
const key = openModal(modalProps =>
|
||||
|
|
@ -503,6 +516,8 @@ export function BookmarkContextMenu({ bookmarks, index, methods }: { bookmarks:
|
|||
checked={showBookmarkBar}
|
||||
id="show-bookmark-bar"
|
||||
label="Bookmark Bar"
|
||||
icon={StarOutlined}
|
||||
leadingAccessory={{ type: "icon", icon: StarOutlined }}
|
||||
action={() => {
|
||||
settings.store.showBookmarkBar = !settings.store.showBookmarkBar;
|
||||
}}
|
||||
|
|
@ -528,6 +543,8 @@ export function TabContextMenu({ tab }: { tab: ChannelTabsProps; }) {
|
|||
<Menu.MenuItem
|
||||
id="mark-as-read"
|
||||
label={getIntlMessage("MARK_AS_READ")}
|
||||
icon={BookCheckIcon}
|
||||
leadingAccessory={{ type: "icon", icon: BookCheckIcon }}
|
||||
disabled={!ReadStateStore.hasUnread(channel.id)}
|
||||
action={() => ReadStateUtils.ackChannel(channel)}
|
||||
/>
|
||||
|
|
@ -536,6 +553,8 @@ export function TabContextMenu({ tab }: { tab: ChannelTabsProps; }) {
|
|||
checked={compact}
|
||||
id="toggle-compact-tab"
|
||||
label="Compact"
|
||||
icon={WindowTopOutlineIcon}
|
||||
leadingAccessory={{ type: "icon", icon: WindowTopOutlineIcon }}
|
||||
action={() => {
|
||||
setCompact(compact => !compact);
|
||||
toggleCompactTab(tab.id);
|
||||
|
|
@ -546,28 +565,38 @@ export function TabContextMenu({ tab }: { tab: ChannelTabsProps; }) {
|
|||
<Menu.MenuItem
|
||||
id="close-tab"
|
||||
label="Close Tab"
|
||||
icon={XLargeBoldIcon}
|
||||
leadingAccessory={{ type: "icon", icon: XLargeBoldIcon }}
|
||||
action={() => closeTab(tab.id)}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
id="close-other-tabs"
|
||||
label="Close Other Tabs"
|
||||
icon={XLargeBoldIcon}
|
||||
leadingAccessory={{ type: "icon", icon: XLargeBoldIcon }}
|
||||
action={() => closeOtherTabs(tab.id)}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
id="close-right-tabs"
|
||||
label="Close Tabs to the Right"
|
||||
icon={XLargeBoldIcon}
|
||||
leadingAccessory={{ type: "icon", icon: XLargeBoldIcon }}
|
||||
disabled={openedTabs.indexOf(tab) === openedTabs.length - 1}
|
||||
action={() => closeTabsToTheRight(tab.id)}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
id="close-left-tabs"
|
||||
label="Close Tabs to the Left"
|
||||
icon={XLargeBoldIcon}
|
||||
leadingAccessory={{ type: "icon", icon: XLargeBoldIcon }}
|
||||
disabled={openedTabs.indexOf(tab) === 0}
|
||||
action={() => closeTabsToTheLeft(tab.id)}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
id="reopen-closed-tab"
|
||||
label="Reopen Closed Tab"
|
||||
icon={UnsendIcon}
|
||||
leadingAccessory={{ type: "icon", icon: UnsendIcon }}
|
||||
disabled={!hasClosedTabs()}
|
||||
action={() => reopenClosedTab()}
|
||||
/>
|
||||
|
|
@ -577,6 +606,8 @@ export function TabContextMenu({ tab }: { tab: ChannelTabsProps; }) {
|
|||
checked={showBookmarkBar}
|
||||
id="show-bookmark-bar"
|
||||
label="Bookmark Bar"
|
||||
icon={StarOutlined}
|
||||
leadingAccessory={{ type: "icon", icon: StarOutlined }}
|
||||
action={() => {
|
||||
settings.store.showBookmarkBar = !settings.store.showBookmarkBar;
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import "./style.css";
|
|||
|
||||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { LinkIcon } from "@components/Icons";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel, Message } from "@vencord/discord-types";
|
||||
|
|
@ -25,6 +26,8 @@ const contextMenuPatch: NavContextMenuPatchCallback = (children, props: { channe
|
|||
<Menu.MenuItem
|
||||
label="Open in New Tab"
|
||||
id="open-link-in-tab"
|
||||
icon={LinkIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LinkIcon }}
|
||||
action={() => createTab({
|
||||
guildId: channel.guild_id || "@me", // Normalize for DMs/Group Chats
|
||||
channelId: channel.id
|
||||
|
|
|
|||
|
|
@ -139,11 +139,6 @@ export const settings = definePluginSettings({
|
|||
type: OptionType.COMPONENT,
|
||||
default: {}
|
||||
},
|
||||
noPomeloNames: {
|
||||
description: "Use display names instead of usernames for DM's",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
showStatusIndicators: {
|
||||
description: "Show status indicators for DM's",
|
||||
type: OptionType.BOOLEAN,
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ const userContextMenuPatch: NavContextMenuPatchCallback = (children, { user, gui
|
|||
<Menu.MenuItem
|
||||
id="CopyProfileColors"
|
||||
icon={ColorIcon}
|
||||
leadingAccessory={{ type: "icon", icon: ColorIcon }}
|
||||
label="Copy Profile Colors"
|
||||
action={() => copyProfileColors(user.id)}
|
||||
/>
|
||||
|
|
@ -104,6 +105,7 @@ const userContextMenuPatch: NavContextMenuPatchCallback = (children, { user, gui
|
|||
<Menu.MenuItem
|
||||
id="CopyServerProfileColors"
|
||||
icon={ColorIcon}
|
||||
leadingAccessory={{ type: "icon", icon: ColorIcon }}
|
||||
label="Copy Server Profile Colors"
|
||||
action={() => copyProfileColors(user.id, effectiveGuildId)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ const UserContextMenuPatch: NavContextMenuPatchCallback = (children, { user }: U
|
|||
label="Copy User Mention"
|
||||
action={() => copyToClipboard(`<@${user.id}>`)}
|
||||
icon={MentionIcon}
|
||||
leadingAccessory={{ type: "icon", icon: MentionIcon }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ const userContextMenuPatch: NavContextMenuPatchCallback = (children, { user }: {
|
|||
label="Set Color"
|
||||
id="set-color"
|
||||
icon={ColorIcon}
|
||||
leadingAccessory={{ type: "icon", icon: ColorIcon }}
|
||||
action={async () => {
|
||||
await requireSettingsMenu();
|
||||
openModal(modalProps => <SetColorModal id={user.id} modalProps={modalProps} />);
|
||||
|
|
@ -66,6 +67,7 @@ const channelContextMenuPatch: NavContextMenuPatchCallback = (children, { channe
|
|||
label="Set Color"
|
||||
id="set-color"
|
||||
icon={ColorIcon}
|
||||
leadingAccessory={{ type: "icon", icon: ColorIcon }}
|
||||
action={async () => {
|
||||
await requireSettingsMenu();
|
||||
openModal(modalProps => <SetColorModal id={channel.id} modalProps={modalProps} />);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,14 @@ async function exportMessage(message: Message) {
|
|||
}
|
||||
}
|
||||
|
||||
function Icon() {
|
||||
return (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
const messageContextMenuPatch = (children: Array<React.ReactElement<any> | null>, props: { message: Message; }) => {
|
||||
const { message } = props;
|
||||
|
||||
|
|
@ -103,11 +111,8 @@ const messageContextMenuPatch = (children: Array<React.ReactElement<any> | null>
|
|||
<Menu.MenuItem
|
||||
id="export-message"
|
||||
label="Export Message"
|
||||
icon={() => (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" />
|
||||
</svg>
|
||||
)}
|
||||
icon={Icon}
|
||||
leadingAccessory={{ type: "icon", icon: Icon }}
|
||||
action={() => exportMessage(message)}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }: { m
|
|||
id="vc-hidemessages"
|
||||
label="Hide"
|
||||
icon={EyeIcon}
|
||||
leadingAccessory={{ type: "icon", icon: EyeIcon }}
|
||||
action={() => hideMessage(message.id, message.channel_id)}
|
||||
/>
|
||||
));
|
||||
|
|
@ -84,6 +85,7 @@ const userCtxPatch: NavContextMenuPatchCallback = (children, { channel }: UserCo
|
|||
id="vc-hidemessages-dm"
|
||||
label={hidden ? "Unhide DM" : "Hide DM"}
|
||||
icon={EyeIcon}
|
||||
leadingAccessory={{ type: "icon", icon: EyeIcon }}
|
||||
action={() => toggleDm(channel.id)}
|
||||
/>
|
||||
));
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ function OtherContextMenu({ iconName, Icon, color }: { iconName: string; Icon: I
|
|||
id="log-console"
|
||||
label="Log to Console"
|
||||
icon={BugIcon}
|
||||
leadingAccessory={{ type: "icon", icon: BugIcon }}
|
||||
action={() => logger.info(Icon)}
|
||||
/>
|
||||
<Menu.MenuItem id="save" label="Save As...">
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ export default definePlugin({
|
|||
showInRoleModal(getMembersInRole(role.id, guild.id), role.id, channel.id);
|
||||
}}
|
||||
icon={InfoIcon}
|
||||
leadingAccessory={{ type: "icon", icon: InfoIcon }}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
|
@ -121,6 +122,7 @@ export default definePlugin({
|
|||
showInRoleModal(getMembersInRole(role.id, guild.id), role.id, channel.id);
|
||||
}}
|
||||
icon={InfoIcon}
|
||||
leadingAccessory={{ type: "icon", icon: InfoIcon }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ const ChannelContextMenuPatch: NavContextMenuPatchCallback = (children, { channe
|
|||
id="LastActive"
|
||||
label={<span style={{ color: "#aa6746" }}>Your Last Message</span>}
|
||||
icon={LastActiveIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LastActiveIcon }}
|
||||
action={() => {
|
||||
jumpToLastActive(channel);
|
||||
}}
|
||||
|
|
@ -98,6 +99,7 @@ const UserContextMenuPatch: NavContextMenuPatchCallback = (children, { user, cha
|
|||
id="LastActive"
|
||||
label={<span style={{ color: "#aa6746" }}>User's Last Message</span>}
|
||||
icon={UserLastActiveIcon}
|
||||
leadingAccessory={{ type: "icon", icon: UserLastActiveIcon }}
|
||||
action={() => {
|
||||
jumpToLastActive(channel, user.id);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ export function LyricsContextMenu() {
|
|||
disabled={!currLyric?.text}
|
||||
action={() => copyWithToast(currLyric!.text!, "Lyric copied!")}
|
||||
icon={CopyIcon}
|
||||
leadingAccessory={{ type: "icon", icon: CopyIcon }}
|
||||
/>
|
||||
|
||||
<Menu.MenuItem
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ function CopyContextMenu({ name, path }: { name: string; path: string; }) {
|
|||
label={`Copy ${name} Link`}
|
||||
action={() => copyWithToast(path.replace("http://", "https://"))}
|
||||
icon={LinkIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LinkIcon }}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
key={openId}
|
||||
|
|
@ -89,6 +90,7 @@ function CopyContextMenu({ name, path }: { name: string; path: string; }) {
|
|||
label={`Open ${name} in Tidal`}
|
||||
action={() => TidalStore.openExternal(path)}
|
||||
icon={OpenExternalIcon}
|
||||
leadingAccessory={{ type: "icon", icon: OpenExternalIcon }}
|
||||
/>
|
||||
</Menu.Menu>
|
||||
);
|
||||
|
|
@ -222,6 +224,7 @@ function AlbumContextMenu({ track }: { track: PlayerState["track"]; }) {
|
|||
label="View Album Cover"
|
||||
action={() => track?.imageSrc && openImageModal({ url: track.imageSrc })}
|
||||
icon={ImageIcon}
|
||||
leadingAccessory={{ type: "icon", icon: ImageIcon }}
|
||||
/>
|
||||
<Menu.MenuControlItem
|
||||
id="tdl-volume"
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export function LyricsContextMenu() {
|
|||
disabled={!currLyric?.text}
|
||||
action={() => copyWithToast(currLyric!.text!, "Lyric copied!")}
|
||||
icon={CopyIcon}
|
||||
leadingAccessory={{ type: "icon", icon: CopyIcon }}
|
||||
/>
|
||||
</Menu.Menu>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ export default definePlugin({
|
|||
id="vc-quote"
|
||||
label="Quote"
|
||||
icon={QuoteIcon}
|
||||
leadingAccessory={{ type: "icon", icon: QuoteIcon }}
|
||||
action={() => openModal(props => <QuoteModal message={message} {...props} />)}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ const MessageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
|
|||
id="vc-remix"
|
||||
label="Remix"
|
||||
icon={PaintbrushIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PaintbrushIcon }}
|
||||
action={() => {
|
||||
const key = openModal(modalProps =>
|
||||
<RemixModal modalProps={modalProps} close={() => closeModal(key)} url={url} />
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ const messageCtxPatch: NavContextMenuPatchCallback = (children, { msg }: { msg:
|
|||
id="vc-repeat"
|
||||
label={shift ? "Repeat and Reply" : "Repeat"}
|
||||
icon={RepeatMessageIcon}
|
||||
leadingAccessory={{ type: "icon", icon: RepeatMessageIcon }}
|
||||
action={async () => repeatMessage(msg)}
|
||||
/>
|
||||
));
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ const addButton = (children, message, url) => {
|
|||
label="Show Embed"
|
||||
action={_ => unfurlEmbed(url, message)}
|
||||
icon={ImageVisible}
|
||||
leadingAccessory={{ type: "icon", icon: ImageVisible }}
|
||||
key="vc-sme-show" />);
|
||||
} else if (isUrlInMessage(message, url)) { // check the url is actually in the message text so we know it's one people can actually add back
|
||||
children.splice(0, 0,
|
||||
|
|
@ -55,6 +56,7 @@ const addButton = (children, message, url) => {
|
|||
label="Remove Embed"
|
||||
action={_ => removeEmbed(url, message)}
|
||||
icon={ImageInvisible}
|
||||
leadingAccessory={{ type: "icon", icon: ImageInvisible }}
|
||||
key="vc-sme-remove" />);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ function makeToggleRoleItem(roleId: string) {
|
|||
<Menu.MenuItem
|
||||
id="toggle"
|
||||
icon={isExcluded ? EyeIcon : EyeSlashIcon}
|
||||
leadingAccessory={{ type: "icon", icon: isExcluded ? EyeIcon : EyeSlashIcon }}
|
||||
label={isExcluded ? "Show Role in Chat" : "Hide Role in Chat"}
|
||||
action={() => toggleRole(roleId)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ function EditableSong({ index, song, insert, setSongRef, onDrag, onDrop, onRemov
|
|||
id="copy-link"
|
||||
label="Copy link"
|
||||
icon={LinkIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LinkIcon }}
|
||||
action={() => render && copyWithToast(render.link)}
|
||||
disabled={!render}
|
||||
/>
|
||||
|
|
@ -76,6 +77,7 @@ function EditableSong({ index, song, insert, setSongRef, onDrag, onDrop, onRemov
|
|||
color="danger"
|
||||
label="Remove song"
|
||||
icon={TrashIcon}
|
||||
leadingAccessory={{ type: "icon", icon: TrashIcon }}
|
||||
action={() => onRemove(song)}
|
||||
/>
|
||||
</Menu.Menu>
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ export default function ProfileSongs({ user, isSideBar }: ProfileSongsProps) {
|
|||
id="edit-songs"
|
||||
label="Edit songs"
|
||||
icon={PencilIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PencilIcon }}
|
||||
action={() => openSettingsModal()}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -117,6 +118,7 @@ export default function ProfileSongs({ user, isSideBar }: ProfileSongsProps) {
|
|||
id="copy-link"
|
||||
label="Copy JSON"
|
||||
icon={LinkIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LinkIcon }}
|
||||
action={() => copyWithToast(JSON.stringify(data))}
|
||||
/>
|
||||
</Menu.Menu>
|
||||
|
|
|
|||
|
|
@ -72,12 +72,14 @@ function SongEntry({ entry, number, isLoaded, isPlaying, big, onClick }: SongEnt
|
|||
id="copy-link"
|
||||
label="Copy link"
|
||||
icon={LinkIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LinkIcon }}
|
||||
action={() => copyWithToast(entry.link)}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
id="steal-song"
|
||||
label="Steal song"
|
||||
icon={PuzzlePieceIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PuzzlePieceIcon }}
|
||||
action={async () => {
|
||||
const self = useSongStore.getState().self?.data ?? [];
|
||||
if (self.length >= apiConstants.songLimit) {
|
||||
|
|
@ -186,6 +188,7 @@ function SongInfo({ owned, song, render, big }: SongInfoProps) {
|
|||
id="copy-link"
|
||||
label="Copy link"
|
||||
icon={LinkIcon}
|
||||
leadingAccessory={{ type: "icon", icon: LinkIcon }}
|
||||
action={() => copyWithToast(render.link)}
|
||||
/>
|
||||
{!owned
|
||||
|
|
@ -194,6 +197,7 @@ function SongInfo({ owned, song, render, big }: SongInfoProps) {
|
|||
id="steal-song"
|
||||
label="Steal song"
|
||||
icon={PuzzlePieceIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PuzzlePieceIcon }}
|
||||
action={() => {
|
||||
const self = useSongStore.getState().self?.data ?? [];
|
||||
if (self.length >= apiConstants.songLimit) {
|
||||
|
|
@ -213,6 +217,7 @@ function SongInfo({ owned, song, render, big }: SongInfoProps) {
|
|||
color="danger"
|
||||
label="Remove song"
|
||||
icon={TrashIcon}
|
||||
leadingAccessory={{ type: "icon", icon: TrashIcon }}
|
||||
action={() => {
|
||||
const self = useSongStore.getState().self?.data ?? [];
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import { proxyLazy } from "@utils/lazy";
|
|||
import { useForceUpdater } from "@utils/react";
|
||||
import definePlugin, { OptionType, StartAt } from "@utils/types";
|
||||
import { extractAndLoadChunksLazy, findComponentByCodeLazy, findModuleId, wreq } from "@webpack";
|
||||
import { Menu, openModalLazy,OverridePremiumTypeStore, Toasts } from "@webpack/common";
|
||||
import { Menu, openModalLazy, OverridePremiumTypeStore, Toasts } from "@webpack/common";
|
||||
|
||||
interface Emoji {
|
||||
animated: boolean;
|
||||
|
|
@ -91,6 +91,10 @@ const StatusSubMenuComponent = () => {
|
|||
? () => <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} />
|
||||
: undefined
|
||||
}
|
||||
leadingAccessory={status.emojiInfo != null
|
||||
? { type: "icon", icon: () => <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> }
|
||||
: undefined
|
||||
}
|
||||
disabled={status.emojiInfo?.id != null && premiumType === 0}
|
||||
>
|
||||
<Menu.MenuItem
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) =>
|
|||
id="ec-trans"
|
||||
label="Translate"
|
||||
icon={Icon}
|
||||
leadingAccessory={{ type: "icon", icon: Icon }}
|
||||
action={() => handleTranslate(message)}
|
||||
/>
|
||||
));
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }: { m
|
|||
id="vc-trivia-ai"
|
||||
label="Answer With AI"
|
||||
icon={RobotIcon}
|
||||
leadingAccessory={{ type: "icon", icon: RobotIcon }}
|
||||
action={async () => {
|
||||
const payload = await getPayload(message);
|
||||
if (!payload) return;
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ export default definePlugin({
|
|||
label="Set Avatar"
|
||||
id="set-avatar"
|
||||
icon={PencilIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PencilIcon }}
|
||||
action={async () => {
|
||||
await requireSettingsModal();
|
||||
openModal(modalProps => <SetAvatarModal userId={user.id} modalProps={modalProps} />);
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ export default definePlugin({
|
|||
label="Copy Role Color"
|
||||
action={() => copyToClipboard(role.colorString!)}
|
||||
icon={AppearanceIcon}
|
||||
leadingAccessory={{ type: "icon", icon: AppearanceIcon }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -265,6 +266,7 @@ export default definePlugin({
|
|||
GuildSettingsActions.selectRole(id);
|
||||
}}
|
||||
icon={PencilIcon}
|
||||
leadingAccessory={{ type: "icon", icon: PencilIcon }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -277,6 +279,7 @@ export default definePlugin({
|
|||
label="View Role Icon"
|
||||
action={() => openRoleIconModal(role.id, roleIcon, role.name)}
|
||||
icon={ImageIcon}
|
||||
leadingAccessory={{ type: "icon", icon: ImageIcon }}
|
||||
/>
|
||||
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue