From d0b69679c3f642927f9a1fbd6660c50f8bd5a31f Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Mon, 10 Jun 2024 17:00:32 -0400
Subject: [PATCH] feat(GlobalBadges): Badge Modal
---
src/equicordplugins/globalBadges/index.tsx | 83 +++++++++++++++++++++-
src/plugins/_api/badges/index.tsx | 8 +--
2 files changed, 82 insertions(+), 9 deletions(-)
diff --git a/src/equicordplugins/globalBadges/index.tsx b/src/equicordplugins/globalBadges/index.tsx
index 2775ca46..8e6fc3db 100644
--- a/src/equicordplugins/globalBadges/index.tsx
+++ b/src/equicordplugins/globalBadges/index.tsx
@@ -17,9 +17,13 @@
*/
import { addBadge, BadgePosition, ProfileBadge, removeBadge } from "@api/Badges";
+import { classNameFactory } from "@api/Styles";
+import ErrorBoundary from "@components/ErrorBoundary";
import { Devs, EquicordDevs } from "@utils/constants";
+import { ModalContent, ModalRoot, openModal } from "@utils/modal";
import definePlugin, { OptionType } from "@utils/types";
-import { React, Tooltip } from "@webpack/common";
+import { Forms, React, Tooltip, UserStore } from "@webpack/common";
+import { User } from "discord-types/general";
type CustomBadge = string | {
name: string;
@@ -32,6 +36,8 @@ interface BadgeCache {
expires: number;
}
+let badgeImages;
+
// const API_URL = "https://clientmodbadges-api.herokuapp.com/";
const API_URL = "https://globalbadges.suncord.rest/";
@@ -72,6 +78,7 @@ const GlobalBadges = ({ userId }: { userId: string; }) => {
if (!badges) return null;
const globalBadges: JSX.Element[] = [];
+ const badgeModal: JSX.Element[] = [];
Object.keys(badges).forEach(mod => {
if (mod.toLowerCase() === "vencord") return;
@@ -90,11 +97,17 @@ const GlobalBadges = ({ userId }: { userId: string; }) => {
const prefix = showPrefix() ? mod : "";
if (!badge.custom) badge.name = `${prefix} ${cleanName.charAt(0).toUpperCase() + cleanName.slice(1)}`;
globalBadges.push(