This commit is contained in:
thororen1234 2024-10-10 20:02:24 -04:00
parent b26faf2e37
commit 6107090950

View file

@ -4,74 +4,56 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
import { ModalProps } from "@utils/modal"; import definePlugin from "@utils/types";
import { User } from "discord-types/general"; import { SettingsRouter } from "@webpack/common";
type Author = { import { settings } from "./utils/settings";
github_name?: string;
discord_name: string;
discord_snowflake: string;
};
export interface Theme { export default definePlugin({
id: string; name: "ThemeLibrary",
name: string; description: "A library of themes for Vencord.",
content: string; authors: [
type: string | "theme" | "snippet"; {
description: string; name: "Fafa",
version: string; id: 428188716641812481n,
author: Author | Author[]; },
likes: number; ],
tags: string[]; settings,
thumbnail_url: string; toolboxActions: {
release_date: Date; "Open Theme Library": () => {
last_updated?: Date; SettingsRouter.open("ThemeLibrary");
guild?: { },
name: string; },
snowflake: string;
invite_link: string; start() {
}; const customSettingsSections = (
source?: string; Vencord.Plugins.plugins.Settings as any as {
requiresThemeAttributes?: boolean; customSections: ((ID: Record<string, unknown>) => any)[];
} }
).customSections;
export interface ThemeInfoModalProps extends ModalProps { const ThemeSection = () => ({
author: User | User[]; section: "ThemeLibrary",
theme: Theme; 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;
export const enum TabItem { const i = customSettingsSections.findIndex(
THEMES, section => section({}).id === "ThemeSection"
SUBMIT_THEMES, );
}
export interface LikesComponentProps { if (i !== -1) customSettingsSections.splice(i, 1);
theme: Theme; },
userId: User["id"]; });
}
export const enum SearchStatus {
ALL,
ENABLED,
DISABLED,
THEME,
SNIPPET,
DARK,
LIGHT,
LIKED,
}
export type ThemeLikeProps = {
status: number;
likes: [{
themeId: number;
userIds: User["id"][];
}];
};
export interface Contributor {
username: User["username"];
github_username: string;
id: User["id"];
avatar: string;
}