Settings: add custom sections support (#1270)
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
f1349a2787
commit
a4191c9f6c
@ -82,6 +82,8 @@ export default definePlugin({
|
|||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
customSections: [] as ((ID: Record<string, unknown>) => any)[],
|
||||||
|
|
||||||
makeSettingsCategories({ ID }: { ID: Record<string, unknown>; }) {
|
makeSettingsCategories({ ID }: { ID: Record<string, unknown>; }) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@ -123,11 +125,13 @@ export default definePlugin({
|
|||||||
label: "Patch Helper",
|
label: "Patch Helper",
|
||||||
element: require("@components/VencordSettings/PatchHelperTab").default,
|
element: require("@components/VencordSettings/PatchHelperTab").default,
|
||||||
},
|
},
|
||||||
|
// TODO: make this use customSections
|
||||||
IS_VENCORD_DESKTOP && {
|
IS_VENCORD_DESKTOP && {
|
||||||
section: "VencordDesktop",
|
section: "VencordDesktop",
|
||||||
label: "Desktop Settings",
|
label: "Desktop Settings",
|
||||||
element: VencordDesktop.Components.Settings,
|
element: VencordDesktop.Components.Settings,
|
||||||
},
|
},
|
||||||
|
...this.customSections.map(func => func(ID)),
|
||||||
{
|
{
|
||||||
section: ID.DIVIDER
|
section: ID.DIVIDER
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user