/* * Vencord, a Discord client mod * Copyright (c) 2025 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { copyToClipboard } from "@utils/clipboard"; import { getIntlMessage } from "@utils/discord"; import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; import { Clickable, ContextMenuApi, FluxDispatcher, Forms, Menu, Text, TooltipContainer, useState } from "@webpack/common"; import type { ComponentPropsWithRef, PropsWithChildren } from "react"; import { _cssColors, cssColors } from "./utils"; function searchMatch(search: string, name: string): boolean { if (search === "") return true; const words = name.toLowerCase().split("_"); const searchKeywords = search.toLowerCase().split(" ").filter(keyword => keyword !== ""); return searchKeywords.every(keyword => words.includes(keyword)) || words.every(keyword => searchKeywords.includes(keyword)) || name.toLowerCase().includes(search.toLowerCase()); } export type ClickableProps = PropsWithChildren> & { tag?: T; }; export function IconTooltip({ children, copy, className, ...props }: ClickableProps & { children: string; copy: string; }) { return { copyToClipboard(copy); }} {...props}>{children} ; } export const ModalHeaderTitle = ({ iconName, color, name }: { iconName: string; color: number; name: string; }) => { return {iconName} {" - "} { ContextMenuApi.openContextMenu(e, () => { const [query, setQuery] = useState(""); return ( FluxDispatcher.dispatch({ type: "CONTEXT_MENU_CLOSE" })} color="danger" aria-label="Icon Viewer Colors" > ( )} /> {!!_cssColors.length && } {_cssColors.map(p => ( searchMatch(query, p) && { // @ts-ignore FluxDispatcher.dispatch({ type: "ICONVIEWER_COLOR_CHANGE", color: p }); }} /> ))} ); }); }}> {cssColors[color]?.name} ; }; export function SettingsAbout() { return <> Features
  • Preview icons
  • Copy icon names and CSS variables
  • Ability to download icons in different formats (SVG, PNG, GIF, etc.)
  • Copy pre-made icon finds for your plugins (Only some icons have this, submit finds either in a server or DMs)
  • Find icons by function context (helpful when creating finds)
  • Search for colors by right-clicking the color name in the modal title
Special thanks
  • krystalskullofficial._.
  • davr1
  • suffocate
; }