From c67cb0261137a606314bbd7e1e501b29a3abfb20 Mon Sep 17 00:00:00 2001
From: nmsturcke <30734036+nmsturcke@users.noreply.github.com>
Date: Mon, 21 Nov 2022 16:27:55 +0100
Subject: Working?
---
.../components/NewBadgeComponent.tsx | 25 ++++++++++++++
src/components/PluginSettings/components/index.ts | 1 +
src/components/PluginSettings/index.tsx | 38 +++++++++++++++++++---
src/components/PluginSettings/styles.ts | 20 ++++++++++++
4 files changed, 80 insertions(+), 4 deletions(-)
create mode 100644 src/components/PluginSettings/components/NewBadgeComponent.tsx
(limited to 'src')
diff --git a/src/components/PluginSettings/components/NewBadgeComponent.tsx b/src/components/PluginSettings/components/NewBadgeComponent.tsx
new file mode 100644
index 0000000..50a6f37
--- /dev/null
+++ b/src/components/PluginSettings/components/NewBadgeComponent.tsx
@@ -0,0 +1,25 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2022 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+*/
+
+import { Badge } from "../styles";
+
+export function NewBadge(): JSX.Element {
+ return (
+
New
+ );
+}
diff --git a/src/components/PluginSettings/components/index.ts b/src/components/PluginSettings/components/index.ts
index 507b53a..6da30c9 100644
--- a/src/components/PluginSettings/components/index.ts
+++ b/src/components/PluginSettings/components/index.ts
@@ -35,3 +35,4 @@ export * from "./SettingNumericComponent";
export * from "./SettingSelectComponent";
export * from "./SettingSliderComponent";
export * from "./SettingTextComponent";
+export * from "./NewBadgeComponent";
diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx
index a0dfc24..4fa2c44 100644
--- a/src/components/PluginSettings/index.tsx
+++ b/src/components/PluginSettings/index.tsx
@@ -17,13 +17,15 @@
*/
import Plugins from "~plugins";
+import { DataStore } from "../../api";
import { showNotice } from "../../api/Notices";
import { Settings, useSettings } from "../../api/settings";
import { startDependenciesRecursive, startPlugin, stopPlugin } from "../../plugins";
+import consoleShortcuts from "../../plugins/consoleShortcuts";
import { ChangeList } from "../../utils/ChangeList";
import Logger from "../../utils/Logger";
-import { classes, LazyComponent, lazyWebpack } from "../../utils/misc";
+import { classes, LazyComponent, lazyWebpack, useAwaiter } from "../../utils/misc";
import { openModalLazy } from "../../utils/modal";
import { Plugin } from "../../utils/types";
import { filters, findByCode } from "../../webpack";
@@ -32,6 +34,7 @@ import ErrorBoundary from "../ErrorBoundary";
import { ErrorCard } from "../ErrorCard";
import { Flex } from "../Flex";
import { handleComponentFailed } from "../handleComponentFailed";
+import { NewBadge } from "./components";
import PluginModal from "./PluginModal";
import * as styles from "./styles";
@@ -77,9 +80,10 @@ interface PluginCardProps extends React.HTMLProps {
plugin: Plugin;
disabled: boolean;
onRestartNeeded(name: string): void;
+ isNew?: boolean;
}
-function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLeave }: PluginCardProps) {
+function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLeave, isNew }: PluginCardProps) {
const settings = useSettings();
const pluginSettings = settings.plugins[plugin.name];
@@ -161,8 +165,8 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe
}
hideBorder={true}
>
-
- {plugin.name}
+
+ {plugin.name}{(isNew) && }