From a4191c9f6c8d1d856935364ea3147c65c1dfe852 Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming00@protonmail.com>
Date: Sun, 11 Jun 2023 17:11:56 -0400
Subject: Settings: add custom sections support (#1270)

Co-authored-by: V <vendicated@riseup.net>
---
 src/plugins/settings.tsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/plugins/settings.tsx')

diff --git a/src/plugins/settings.tsx b/src/plugins/settings.tsx
index 2201ece..3ea5a43 100644
--- a/src/plugins/settings.tsx
+++ b/src/plugins/settings.tsx
@@ -82,6 +82,8 @@ export default definePlugin({
         }
     }],
 
+    customSections: [] as ((ID: Record<string, unknown>) => any)[],
+
     makeSettingsCategories({ ID }: { ID: Record<string, unknown>; }) {
         return [
             {
@@ -123,11 +125,13 @@ export default definePlugin({
                 label: "Patch Helper",
                 element: require("@components/VencordSettings/PatchHelperTab").default,
             },
+            // TODO: make this use customSections
             IS_VENCORD_DESKTOP && {
                 section: "VencordDesktop",
                 label: "Desktop Settings",
                 element: VencordDesktop.Components.Settings,
             },
+            ...this.customSections.map(func => func(ID)),
             {
                 section: ID.DIVIDER
             }
-- 
cgit 

