diff --git a/src/components/CodeBlock.tsx b/src/components/CodeBlock.tsx index e85e7ed7d..b4a1ccbb8 100644 --- a/src/components/CodeBlock.tsx +++ b/src/components/CodeBlock.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { classes } from "@utils/misc"; import { findCssClassesLazy } from "@webpack"; import { Parser } from "@webpack/common"; @@ -12,9 +13,9 @@ const CodeContainerClasses = findCssClassesLazy("markup", "codeContainer"); /** * Renders code in a Discord codeblock */ -export function CodeBlock(props: { content?: string, lang: string; }) { +export function CodeBlock({ className, ...props }: { content?: string, lang: string; className?: string; }) { return ( -
+
{Parser.defaultRules.codeBlock.react(props, null, {})}
); @@ -23,9 +24,9 @@ export function CodeBlock(props: { content?: string, lang: string; }) { /** * Renders inline code like `this` */ -export function InlineCode({ children }: { children: React.ReactNode; }) { +export function InlineCode({ children, className }: { children: React.ReactNode; className?: string; }) { return ( - + {children} ); diff --git a/src/components/Icons.tsx b/src/components/Icons.tsx index d3e9c21ae..b85a54079 100644 --- a/src/components/Icons.tsx +++ b/src/components/Icons.tsx @@ -81,6 +81,31 @@ export function CopyIcon(props: IconProps) { ); } +/** + * Discord's ID icon, as seen in Developer Mode "Copy ID" context menu items + */ +export function CopyIdIcon(props: IconProps) { + return ( + + + + + ); +} + + /** * Discord's open external icon, as seen in the user profile connections */ diff --git a/src/components/settings/tabs/plugins/components/BooleanSetting.tsx b/src/components/settings/tabs/plugins/components/BooleanSetting.tsx index 22596c3ba..875cf7112 100644 --- a/src/components/settings/tabs/plugins/components/BooleanSetting.tsx +++ b/src/components/settings/tabs/plugins/components/BooleanSetting.tsx @@ -41,7 +41,7 @@ export function BooleanSetting({ setting, pluginSettings, definedSettings, id, o } return ( - +
- {name && {wordsToTitle(wordsFromCamel(name))}} + {name ?? wordsToTitle(wordsFromCamel(id))} {description && {description}}
{children} diff --git a/src/components/settings/tabs/plugins/components/NumberSetting.tsx b/src/components/settings/tabs/plugins/components/NumberSetting.tsx index fa348a108..36837abc9 100644 --- a/src/components/settings/tabs/plugins/components/NumberSetting.tsx +++ b/src/components/settings/tabs/plugins/components/NumberSetting.tsx @@ -50,7 +50,7 @@ export function NumberSetting({ setting, pluginSettings, definedSettings, id, on } return ( - + +