aboutsummaryrefslogtreecommitdiff
path: root/src/components/PluginSettings/index.tsx
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-11-21 18:46:09 +0100
committernea <romangraef@gmail.com>2022-11-21 21:50:46 +0100
commit7b5c8c9cd3256bf1041024176bba6b748a4638da (patch)
tree74c8388dd2660c5644f74971997ce505664a1006 /src/components/PluginSettings/index.tsx
parent0d4d020affa62ee8ff1cc327970352a691cfd246 (diff)
downloadVencord-7b5c8c9cd3256bf1041024176bba6b748a4638da.tar.gz
Vencord-7b5c8c9cd3256bf1041024176bba6b748a4638da.tar.bz2
Vencord-7b5c8c9cd3256bf1041024176bba6b748a4638da.zip
UserPlugins: Add clickable badges to external user pluginsfeat/userpluginbadge
This patch adds a button to each user plugin (this is determined by the plugin directory). Additionally user plugins can specify an `externalLink` in their plugin definition to have their badge be clickable and link to an external website. Co-Authored-By: exhq <91651232+exhq@users.noreply.github.com>
Diffstat (limited to 'src/components/PluginSettings/index.tsx')
-rw-r--r--src/components/PluginSettings/index.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx
index ad1cd32..f075d26 100644
--- a/src/components/PluginSettings/index.tsx
+++ b/src/components/PluginSettings/index.tsx
@@ -34,6 +34,7 @@ import { ErrorCard } from "../ErrorCard";
import { Flex } from "../Flex";
import { handleComponentFailed } from "../handleComponentFailed";
import { Badge } from "./components";
+import UserPluginBadge from "./components/UserPluginBadge";
import PluginModal from "./PluginModal";
import * as styles from "./styles";
@@ -165,7 +166,9 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe
hideBorder={true}
>
<Flex style={{ marginTop: "auto", width: "100%", height: "100%", alignItems: "center", gap: "8px" }}>
- <Text variant="text-md/bold" style={{ display: "flex", width: "100%", alignItems: "center", flexGrow: "1", gap: "8px" }}>{plugin.name}{(isNew) && <Badge text="New" color="#ED4245" />}</Text>
+ <Text variant="text-md/bold" style={{ display: "flex", width: "100%", alignItems: "center", flexGrow: "1", gap: "8px" }}>
+ {plugin.name}{isNew && <Badge text="New" color="#ed4245" />}{plugin.isUserPlugin && <UserPluginBadge plugin={plugin} />}
+ </Text>
<button role="switch" onClick={() => openModal()} style={styles.SettingsIcon} className="button-12Fmur">
{plugin.options
? <CogWheel