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;
};
source?: string;
requiresThemeAttributes?: boolean;
}
export interface ThemeInfoModalProps extends ModalProps { start() {
author: User | User[]; const customSettingsSections = (
theme: Theme; Vencord.Plugins.plugins.Settings as any as {
} customSections: ((ID: Record<string, unknown>) => any)[];
}
).customSections;
export const enum TabItem { const ThemeSection = () => ({
THEMES, section: "ThemeLibrary",
SUBMIT_THEMES, label: "Theme Library",
} searchableTitles: ["Theme Library"],
element: require("./components/ThemeTab").default,
id: "ThemeSection",
});
export interface LikesComponentProps { customSettingsSections.push(ThemeSection);
theme: Theme; },
userId: User["id"];
}
export const enum SearchStatus { stop() {
ALL, const customSettingsSections = (
ENABLED, Vencord.Plugins.plugins.Settings as any as {
DISABLED, customSections: ((ID: Record<string, unknown>) => any)[];
THEME, }
SNIPPET, ).customSections;
DARK,
LIGHT,
LIKED,
}
export type ThemeLikeProps = { const i = customSettingsSections.findIndex(
status: number; section => section({}).id === "ThemeSection"
likes: [{ );
themeId: number;
userIds: User["id"][];
}];
};
export interface Contributor { if (i !== -1) customSettingsSections.splice(i, 1);
username: User["username"]; },
github_username: string; });
id: User["id"];
avatar: string;
}