diff options
Diffstat (limited to 'src/plugins/settings.tsx')
-rw-r--r-- | src/plugins/settings.tsx | 81 |
1 files changed, 35 insertions, 46 deletions
diff --git a/src/plugins/settings.tsx b/src/plugins/settings.tsx index c8a6372..f9a7548 100644 --- a/src/plugins/settings.tsx +++ b/src/plugins/settings.tsx @@ -71,66 +71,63 @@ export default definePlugin({ makeSettingsCategories({ ID }: { ID: Record<string, unknown>; }) { const makeOnClick = (tab: string) => () => SettingsRouter.open(tab); - const cats = [ + return [ { section: ID.HEADER, label: "Vencord" - }, { + }, + { section: "VencordSettings", label: "Vencord", element: () => <SettingsComponent tab="VencordSettings" />, onClick: makeOnClick("VencordSettings") - }, { + }, + { section: "VencordPlugins", label: "Plugins", element: () => <SettingsComponent tab="VencordPlugins" />, onClick: makeOnClick("VencordPlugins") - }, { + }, + { section: "VencordThemes", label: "Themes", element: () => <SettingsComponent tab="VencordThemes" />, onClick: makeOnClick("VencordThemes") - } - ] as Array<{ - section: unknown, - label?: string; - element?: React.ComponentType; - onClick?(): void; - }>; - - if (!IS_WEB) - cats.push({ + }, + !IS_WEB && { section: "VencordUpdater", label: "Updater", element: () => <SettingsComponent tab="VencordUpdater" />, onClick: makeOnClick("VencordUpdater") - }); - - cats.push({ - section: "VencordCloud", - label: "Cloud", - element: () => <SettingsComponent tab="VencordCloud" />, - onClick: makeOnClick("VencordCloud") - }); - - cats.push({ - section: "VencordSettingsSync", - label: "Backup & Restore", - element: () => <SettingsComponent tab="VencordSettingsSync" />, - onClick: makeOnClick("VencordSettingsSync") - }); - - if (IS_DEV) - cats.push({ + }, + { + section: "VencordCloud", + label: "Cloud", + element: () => <SettingsComponent tab="VencordCloud" />, + onClick: makeOnClick("VencordCloud") + }, + { + section: "VencordSettingsSync", + label: "Backup & Restore", + element: () => <SettingsComponent tab="VencordSettingsSync" />, + onClick: makeOnClick("VencordSettingsSync") + }, + IS_DEV && { section: "VencordPatchHelper", label: "Patch Helper", element: PatchHelper!, onClick: makeOnClick("VencordPatchHelper") - }); - - cats.push({ section: ID.DIVIDER }); - - return cats; + }, + IS_VENCORD_DESKTOP && { + section: "VencordDesktop", + label: "Desktop Settings", + element: VencordDesktop.Components.Settings, + onClick: makeOnClick("VencordDesktop") + }, + { + section: ID.DIVIDER + } + ].filter(Boolean); }, options: { @@ -149,14 +146,6 @@ export default definePlugin({ }, }, - tabs: { - vencord: () => <SettingsComponent tab="VencordSettings" />, - plugins: () => <SettingsComponent tab="VencordPlugins" />, - themes: () => <SettingsComponent tab="VencordThemes" />, - updater: () => <SettingsComponent tab="VencordUpdater" />, - sync: () => <SettingsComponent tab="VencordSettingsSync" /> - }, - get electronVersion() { return VencordNative.getVersions().electron || window.armcord?.electron || null; }, @@ -175,7 +164,7 @@ export default definePlugin({ get additionalInfo() { if (IS_DEV) return " (Dev)"; if (IS_WEB) return " (Web)"; - if (IS_VENCORD_DESKTOP) return " (Vencord Desktop)"; + if (IS_VENCORD_DESKTOP) return ` (VencordDesktop v${VencordDesktopNative.app.getVersion()})`; if (IS_STANDALONE) return " (Standalone)"; return ""; }, |