Skip to content

Commit 6ae0c83

Browse files
committed
Add New Badges
- Equicord - Raincord - ReviewDB
1 parent 7d2f92a commit 6ae0c83

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

plugins/globalBadges/src/badgeGroups.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,42 @@ const badgeGroups = {
191191
}
192192
return badges;
193193
},
194+
equicord: (value: CustomBadges["equicord"]) => {
195+
const badges: BadgeGroupItem[] = [];
196+
if (value?.contributor) {
197+
badges.push({
198+
type: "contributor",
199+
label: "Vencord Contributor",
200+
uri: "https://equicord.org/assets/icons/equicord/icon.png",
201+
});
202+
}
203+
if (Array.isArray(value?.cutie)) {
204+
value.cutie.forEach((cutie, idx) => {
205+
badges.push({
206+
type: `cutie${idx}`,
207+
label: cutie.tooltip,
208+
uri: cutie.image,
209+
});
210+
});
211+
}
212+
return badges;
213+
},
214+
raincord: (value: CustomBadges["raincord"]) => {
215+
if (!Array.isArray(value)) return [];
216+
return value.map((badge) => ({
217+
type: badge.label,
218+
label: badge.label,
219+
uri: badge.url,
220+
}));
221+
},
222+
reviewdb: (value: CustomBadges["reviewdb"]) => {
223+
if (!Array.isArray(value)) return [];
224+
return value.map((badge) => ({
225+
type: badge.name,
226+
label: badge.name,
227+
uri: badge.icon,
228+
}));
229+
}
194230
};
195231

196232
export default badgeGroups;

plugins/globalBadges/src/types.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@ export interface CustomBadges {
9393
}
9494
];
9595
};
96+
equicord: {
97+
contributor: boolean;
98+
cutie: [
99+
{
100+
tooltip: string;
101+
image: string;
102+
}
103+
];
104+
};
105+
raincord: [
106+
{
107+
label: string;
108+
url: string;
109+
}
110+
]
111+
reviewdb: [
112+
{
113+
name: string;
114+
icon: string;
115+
redirectURL: string;
116+
description: string;
117+
}
118+
]
96119
}
97120

98121
// export interface BadgeProps {

0 commit comments

Comments
 (0)