diff --git a/src/components/settings/tabs/plugins/PluginModal.tsx b/src/components/settings/tabs/plugins/PluginModal.tsx index d34be261..55912d9d 100644 --- a/src/components/settings/tabs/plugins/PluginModal.tsx +++ b/src/components/settings/tabs/plugins/PluginModal.tsx @@ -116,7 +116,11 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti ); }); - return {options}; + return ( +
+ {options} +
+ ); } function renderMoreUsers(_label: string, count: number) { diff --git a/src/components/settings/tabs/plugins/components/BooleanSetting.tsx b/src/components/settings/tabs/plugins/components/BooleanSetting.tsx index c022fa2d..c5408cb9 100644 --- a/src/components/settings/tabs/plugins/components/BooleanSetting.tsx +++ b/src/components/settings/tabs/plugins/components/BooleanSetting.tsx @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -import { wordsFromCamel, wordsToTitle } from "@utils/text"; +import { Switch } from "@components/settings/Switch"; import { PluginOptionBoolean } from "@utils/types"; -import { Forms, React, Switch, useState } from "@webpack/common"; +import { React, useState } from "@webpack/common"; -import { resolveError, SettingProps } from "./Common"; +import { resolveError, SettingProps, SettingsSection } from "./Common"; export function BooleanSetting({ option, pluginSettings, definedSettings, id, onChange }: SettingProps) { const def = pluginSettings[id] ?? option.default; @@ -40,20 +40,9 @@ export function BooleanSetting({ option, pluginSettings, definedSettings, id, on } return ( - - - {wordsToTitle(wordsFromCamel(id))} - - {error && {error}} - + + + ); } diff --git a/src/components/settings/tabs/plugins/components/Common.tsx b/src/components/settings/tabs/plugins/components/Common.tsx index 06083767..3d84859b 100644 --- a/src/components/settings/tabs/plugins/components/Common.tsx +++ b/src/components/settings/tabs/plugins/components/Common.tsx @@ -4,12 +4,15 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { Margins } from "@utils/margins"; +import { classNameFactory } from "@api/Styles"; +import { classes } from "@utils/misc"; import { wordsFromCamel, wordsToTitle } from "@utils/text"; import { DefinedSettings, PluginOptionBase } from "@utils/types"; -import { Forms } from "@webpack/common"; +import { Text } from "@webpack/common"; import { PropsWithChildren } from "react"; +export const cl = classNameFactory("vc-plugins-setting-"); + interface SettingBaseProps { option: T; onChange(newValue: any): void; @@ -34,15 +37,20 @@ interface SettingsSectionProps extends PropsWithChildren { name: string; description: string; error: string | null; + inlineSetting?: boolean; } -export function SettingsSection({ name, description, error, children }: SettingsSectionProps) { +export function SettingsSection({ name, description, error, inlineSetting, children }: SettingsSectionProps) { return ( - - {wordsToTitle(wordsFromCamel(name))} - {description} - {children} - {error && {error}} - +
+
+
+ {name && {wordsToTitle(wordsFromCamel(name))}} + {description && {description}} +
+ {children} +
+ {error && {error}} +
); } diff --git a/src/components/settings/tabs/plugins/components/NumberSetting.tsx b/src/components/settings/tabs/plugins/components/NumberSetting.tsx index 1b2e01a9..108ddc3e 100644 --- a/src/components/settings/tabs/plugins/components/NumberSetting.tsx +++ b/src/components/settings/tabs/plugins/components/NumberSetting.tsx @@ -53,9 +53,9 @@ export function NumberSetting({ option, pluginSettings, definedSettings, id, onC diff --git a/src/components/settings/tabs/plugins/components/SelectSetting.tsx b/src/components/settings/tabs/plugins/components/SelectSetting.tsx index 35512a21..4c912c51 100644 --- a/src/components/settings/tabs/plugins/components/SelectSetting.tsx +++ b/src/components/settings/tabs/plugins/components/SelectSetting.tsx @@ -41,14 +41,14 @@ export function SelectSetting({ option, pluginSettings, definedSettings, onChang return (