mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
feat(settings): new settings design (#261)
This commit is contained in:
parent
a85ec594a7
commit
6b55dee9fb
14 changed files with 369 additions and 162 deletions
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue