-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
49 lines (39 loc) · 1.53 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
/*
* 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 { openModal } from "@utils/modal";
import { classNameFactory } from "@api/Styles";
import { pluginSettings } from "./utils/settings";
import { BadgeModal } from "./components/modals/BadgeModal";
import { BadgeHandler, CategoryHandler } from "./utils/badge/data";
import { addPatchContext_manageBadges, removePatchContext_manageBadges } from "./components/context";
import { DEFAULT_BADGE_CATEGORY, DEFAULT_BADGE_CATEGORY_URL } from "./utils/constants";
export const cl = classNameFactory("pb-");
export default definePlugin({
name: "PersonalBadges",
description: "Create profile badges that are exclusively visible to you through locally stored data.",
authors: [{
name: "YLohkuhl",
id: 1204700402235478078n
}],
dependencies: ["BadgeAPI"],
settings: pluginSettings,
toolboxActions: {
"Reinitialize Cache": async () => await BadgeHandler.re_init(),
"Open Badge Modal": () => openModal(props => <BadgeModal { ...props } />)
},
async start()
{
await BadgeHandler.init();
await CategoryHandler.register({id: "", name: DEFAULT_BADGE_CATEGORY, icon: DEFAULT_BADGE_CATEGORY_URL, badges: []});
addPatchContext_manageBadges();
},
stop()
{
removePatchContext_manageBadges();
BadgeHandler.de_init();
}
});