Equicord/src/equicordplugins/components.dev/index.tsx

44 lines
1.4 KiB
TypeScript
Raw Normal View History

/*
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./styles.css";
2026-03-03 11:34:12 -05:00
import { ComponentsIcon } from "@components/Icons";
2026-02-10 18:14:25 -05:00
import SettingsPlugin from "@plugins/_core/settings";
2026-02-04 14:16:50 -05:00
import { Devs } from "@utils/constants";
2026-02-10 18:14:25 -05:00
import { removeFromArray } from "@utils/misc";
import definePlugin, { StartAt } from "@utils/types";
import { SettingsRouter } from "@webpack/common";
import ComponentsTab from "./components/ComponentsTab";
export default definePlugin({
name: "Components",
description: "Adds a new tab to settings to browse Discord components.",
2026-02-04 14:16:50 -05:00
authors: [Devs.prism],
dependencies: ["Settings"],
startAt: StartAt.WebpackReady,
toolboxActions: {
"Open Components Tab"() {
SettingsRouter.openUserSettings("equicord_components_panel");
},
},
start() {
2026-02-10 18:14:25 -05:00
SettingsPlugin.customEntries.push({
key: "equicord_components",
title: "Components",
Component: ComponentsTab,
Icon: ComponentsIcon
});
2026-02-10 18:14:25 -05:00
SettingsPlugin.settingsSectionMap.push(["EquicordDiscordComponents", "equicord_components"]);
},
stop() {
2026-02-10 18:14:25 -05:00
removeFromArray(SettingsPlugin.customEntries, e => e.key === "equicord_components");
removeFromArray(SettingsPlugin.settingsSectionMap, entry => entry[1] === "equicord_components");
},
});