mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-14 17:13:03 -04:00
e er
This commit is contained in:
parent
b1d87cbdef
commit
63656f1018
3 changed files with 75 additions and 0 deletions
|
@ -58,6 +58,7 @@ const EquicordContributorBadge: ProfileBadge = {
|
|||
|
||||
let DonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
let EquicordDonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
let SuncordDonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
|
||||
async function loadBadges(url: string, noCache = false) {
|
||||
const init = {} as RequestInit;
|
||||
|
@ -69,9 +70,11 @@ async function loadBadges(url: string, noCache = false) {
|
|||
async function loadAllBadges(noCache = false) {
|
||||
const vencordBadges = await loadBadges("https://badges.vencord.dev/badges.json", noCache);
|
||||
const equicordBadges = await loadBadges("https://raw.githubusercontent.com/Equicord/Ignore/main/badges.json", noCache);
|
||||
const suncordBadges = await loadBadges("https://raw.githubusercontent.com/verticalsync/Suncord/main/src/assets/badges.json", noCache);
|
||||
|
||||
DonorBadges = vencordBadges;
|
||||
EquicordDonorBadges = equicordBadges;
|
||||
SuncordDonorBadges = suncordBadges;
|
||||
}
|
||||
|
||||
|
||||
|
@ -269,5 +272,74 @@ export default definePlugin({
|
|||
));
|
||||
},
|
||||
}));
|
||||
},
|
||||
|
||||
getSuncordDonorBadges(userId: string) {
|
||||
return SuncordDonorBadges[userId]?.map(badge => ({
|
||||
image: badge.badge,
|
||||
description: badge.tooltip,
|
||||
position: BadgePosition.START,
|
||||
props: {
|
||||
style: {
|
||||
borderRadius: "50%",
|
||||
transform: "scale(0.9)" // The image is a bit too big compared to default badges
|
||||
}
|
||||
},
|
||||
onClick() {
|
||||
const modalKey = openModal(props => (
|
||||
<ErrorBoundary noop onError={() => {
|
||||
closeModal(modalKey);
|
||||
VencordNative.native.openExternal("https://github.com/sponsors/verticalsync");
|
||||
}}>
|
||||
<Modals.ModalRoot {...props}>
|
||||
<Modals.ModalHeader>
|
||||
<Flex style={{ width: "100%", justifyContent: "center" }}>
|
||||
<Forms.FormTitle
|
||||
tag="h2"
|
||||
style={{
|
||||
width: "100%",
|
||||
textAlign: "center",
|
||||
margin: 0
|
||||
}}
|
||||
>
|
||||
<Heart />
|
||||
Suncord Donor
|
||||
</Forms.FormTitle>
|
||||
</Flex>
|
||||
</Modals.ModalHeader>
|
||||
<Modals.ModalContent>
|
||||
<Flex>
|
||||
<img
|
||||
role="presentation"
|
||||
src="https://cdn.discordapp.com/emojis/1026533070955872337.png"
|
||||
alt=""
|
||||
style={{ margin: "auto" }}
|
||||
/>
|
||||
<img
|
||||
role="presentation"
|
||||
src="https://cdn.discordapp.com/emojis/1026533090627174460.png"
|
||||
alt=""
|
||||
style={{ margin: "auto" }}
|
||||
/>
|
||||
</Flex>
|
||||
<div style={{ padding: "1em" }}>
|
||||
<Forms.FormText>
|
||||
This Badge is a special perk for Suncord Donors
|
||||
</Forms.FormText>
|
||||
<Forms.FormText className={Margins.top20}>
|
||||
Please consider supporting the development of Suncord by becoming a donor. It would mean a lot!!
|
||||
</Forms.FormText>
|
||||
</div>
|
||||
</Modals.ModalContent>
|
||||
<Modals.ModalFooter>
|
||||
<Flex style={{ width: "100%", justifyContent: "center" }}>
|
||||
<DonateButton />
|
||||
</Flex>
|
||||
</Modals.ModalFooter>
|
||||
</Modals.ModalRoot>
|
||||
</ErrorBoundary>
|
||||
));
|
||||
},
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue