diff options
author | V <vendicated@riseup.net> | 2023-08-12 02:59:24 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-08-12 02:59:24 +0200 |
commit | 243381fc91bbf0c2c4ac83768edad3f45fc06e26 (patch) | |
tree | ea8185fdc590072bd834982ae48d14ddc83dde2d /src/plugins | |
parent | 54cbdfdad0a2ba4fd8144c6025d6121233cc7416 (diff) | |
download | Vencord-243381fc91bbf0c2c4ac83768edad3f45fc06e26.tar.gz Vencord-243381fc91bbf0c2c4ac83768edad3f45fc06e26.tar.bz2 Vencord-243381fc91bbf0c2c4ac83768edad3f45fc06e26.zip |
Settings: Give vencord sections classes so themes can match them
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/_core/settings.tsx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 3ea5a43..ed58865 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -19,7 +19,6 @@ import { addContextMenuPatch } from "@api/ContextMenu"; import { Settings } from "@api/Settings"; import { Devs } from "@utils/constants"; -import { Logger } from "@utils/Logger"; import definePlugin, { OptionType } from "@utils/types"; import { React, SettingsRouter } from "@webpack/common"; @@ -66,16 +65,11 @@ export default definePlugin({ case "top": return /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.USER_SETTINGS\}/; case "aboveNitro": return /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.BILLING_SETTINGS\}/; case "belowNitro": return /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.APP_SETTINGS\}/; - case "aboveActivity": return /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/; case "belowActivity": return /(?<=\{section:(.{1,2})\.ID\.DIVIDER},)\{section:"changelog"/; case "bottom": return /\{section:(.{1,2})\.ID\.CUSTOM,\s*element:.+?}/; - default: { - new Logger("Settings").error( - new Error("No switch case matched????? Don't mess with the settings, silly") - ); - // matches nothing - return /(?!a)a/; - } + case "aboveActivity": + default: + return /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/; } }, replace: "...$self.makeSettingsCategories($1),$&" @@ -88,48 +82,57 @@ export default definePlugin({ return [ { section: ID.HEADER, - label: "Vencord" + label: "Vencord", + className: "vc-settings-header" }, { section: "VencordSettings", label: "Vencord", - element: require("@components/VencordSettings/VencordTab").default + element: require("@components/VencordSettings/VencordTab").default, + className: "vc-settings" }, { section: "VencordPlugins", label: "Plugins", element: require("@components/VencordSettings/PluginsTab").default, + className: "vc-plugins" }, { section: "VencordThemes", label: "Themes", element: require("@components/VencordSettings/ThemesTab").default, + className: "vc-themes" }, !IS_WEB && { section: "VencordUpdater", label: "Updater", element: require("@components/VencordSettings/UpdaterTab").default, + className: "vc-updater" }, { section: "VencordCloud", label: "Cloud", element: require("@components/VencordSettings/CloudTab").default, + className: "vc-cloud" }, { section: "VencordSettingsSync", label: "Backup & Restore", element: require("@components/VencordSettings/BackupAndRestoreTab").default, + className: "vc-backup-restore" }, IS_DEV && { section: "VencordPatchHelper", label: "Patch Helper", element: require("@components/VencordSettings/PatchHelperTab").default, + className: "vc-patch-helper" }, // TODO: make this use customSections IS_VENCORD_DESKTOP && { section: "VencordDesktop", label: "Desktop Settings", element: VencordDesktop.Components.Settings, + className: "vc-desktop-settings" }, ...this.customSections.map(func => func(ID)), { |