diff options
author | megumin <megumin.bakaretsurie@gmail.com> | 2022-11-25 22:38:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 22:38:55 +0000 |
commit | 6b55dee9fbba1a54cbe2ba1f2067e2d14190ab93 (patch) | |
tree | 4245702e4ae95647d344ba3b22893bdd0e3b1bb6 /src/plugins/settings.tsx | |
parent | a85ec594a77557e5f48c4cf1aa33680e0da94654 (diff) | |
download | Vencord-6b55dee9fbba1a54cbe2ba1f2067e2d14190ab93.tar.gz Vencord-6b55dee9fbba1a54cbe2ba1f2067e2d14190ab93.tar.bz2 Vencord-6b55dee9fbba1a54cbe2ba1f2067e2d14190ab93.zip |
feat(settings): new settings design (#261)
Diffstat (limited to 'src/plugins/settings.tsx')
-rw-r--r-- | src/plugins/settings.tsx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/plugins/settings.tsx b/src/plugins/settings.tsx index ec42956..2777572 100644 --- a/src/plugins/settings.tsx +++ b/src/plugins/settings.tsx @@ -19,8 +19,11 @@ import gitHash from "~git-hash"; import { Devs } from "../utils/constants"; +import { LazyComponent } from "../utils/misc"; import definePlugin from "../utils/types"; +const SettingsComponent = LazyComponent(() => require("../components/VencordSettings").default); + export default definePlugin({ name: "Settings", description: "Adds Settings UI and debug info", @@ -42,13 +45,15 @@ export default definePlugin({ replacement: { match: /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/, replace: (m, mod) => { - const updater = !IS_WEB ? '{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater},' : ""; - const patchHelper = IS_DEV ? '{section:"VencordPatchHelper",label:"PatchHelper",element:Vencord.Components.PatchHelper},' : ""; + const updater = !IS_WEB ? '{section:"VencordUpdater",label:"Updater",element:Vencord.Plugins.plugins.Settings.tabs.updater},' : ""; + const patchHelper = IS_DEV ? '{section:"VencordPatchHelper",label:"Patch Helper",element:Vencord.Components.PatchHelper},' : ""; return ( `{section:${mod}.ID.HEADER,label:"Vencord"},` + - '{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},' + - '{section:"VencordPlugins",label:"Plugins",element:Vencord.Components.PluginSettings},' + + '{section:"VencordSettings",label:"Vencord",element:Vencord.Plugins.plugins.Settings.tabs.vencord},' + + '{section:"VencordPlugins",label:"Plugins",element:Vencord.Plugins.plugins.Settings.tabs.plugins},' + + '{section:"VencordThemes",label:"Themes",element:Vencord.Plugins.plugins.Settings.tabs.themes},' + updater + + '{section:"VencordSettingsSync",label:"Backup & Restore",element:Vencord.Plugins.plugins.Settings.tabs.sync},' + patchHelper + `{section:${mod}.ID.DIVIDER},${m}` ); @@ -56,6 +61,14 @@ 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; }, |