-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.tsx
59 lines (50 loc) · 1.56 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import definePlugin from "@utils/types";
import { SettingsRouter } from "@webpack/common";
import { settings } from "./utils/settings";
export default definePlugin({
name: "ThemeLibrary",
description: "A library of themes for Vencord.",
authors: [
{
name: "Fafa",
id: 428188716641812481n,
},
],
settings,
toolboxActions: {
"Open Theme Library": () => {
SettingsRouter.open("ThemeLibrary");
},
},
start() {
const customSettingsSections = (
Vencord.Plugins.plugins.Settings as any as {
customSections: ((ID: Record<string, unknown>) => any)[];
}
).customSections;
const ThemeSection = () => ({
section: "ThemeLibrary",
label: "Theme Library",
searchableTitles: ["Theme Library"],
element: require("./components/ThemeTab").default,
id: "ThemeSection",
});
customSettingsSections.push(ThemeSection);
},
stop() {
const customSettingsSections = (
Vencord.Plugins.plugins.Settings as any as {
customSections: ((ID: Record<string, unknown>) => any)[];
}
).customSections;
const i = customSettingsSections.findIndex(
section => section({}).id === "ThemeSection"
);
if (i !== -1) customSettingsSections.splice(i, 1);
},
});