mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 09:33:03 -04:00
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
/*
|
|
* Vencord, a Discord client mod
|
|
* Copyright (c) 2024 Vendicated and contributors
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
import { EquicordDevs } from "@utils/constants";
|
|
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: [EquicordDevs.Fafa],
|
|
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;
|
|
|
|
customSettingsSections.push(_ => ({
|
|
section: "ThemeLibrary",
|
|
label: "Theme Library",
|
|
searchableTitles: ["Theme Library"],
|
|
element: require("./components/ThemeTab").default,
|
|
id: "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);
|
|
},
|
|
});
|