From 374531d10e8c12803036867de84edeca10fe2e25 Mon Sep 17 00:00:00 2001 From: A user Date: Mon, 2 Jan 2023 22:30:54 -0300 Subject: [PATCH] Extract inline styles to css (#370) --- .../components/BadgeComponent.tsx | 7 +-- src/components/PluginSettings/index.tsx | 18 +++--- src/components/PluginSettings/styles.css | 61 +++++++++++++++++++ src/components/PluginSettings/styles.ts | 61 ------------------- .../VencordSettings/BackupRestoreTab.tsx | 9 +-- src/components/VencordSettings/ThemesTab.tsx | 6 +- src/components/VencordSettings/Updater.tsx | 12 ++-- src/components/VencordSettings/VencordTab.tsx | 28 +++------ src/components/VencordSettings/index.tsx | 7 ++- .../VencordSettings/settingsStyles.css | 24 +++++++- src/utils/misc.tsx | 2 +- 11 files changed, 121 insertions(+), 114 deletions(-) create mode 100644 src/components/PluginSettings/styles.css delete mode 100644 src/components/PluginSettings/styles.ts diff --git a/src/components/PluginSettings/components/BadgeComponent.tsx b/src/components/PluginSettings/components/BadgeComponent.tsx index 059376fd..6acf42a1 100644 --- a/src/components/PluginSettings/components/BadgeComponent.tsx +++ b/src/components/PluginSettings/components/BadgeComponent.tsx @@ -16,15 +16,12 @@ * along with this program. If not, see . */ -import { BadgeStyle } from "@components/PluginSettings/styles"; - export function Badge({ text, color }): JSX.Element { return ( -
{text}
); } diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 98189145..27618d43 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -16,16 +16,18 @@ * along with this program. If not, see . */ +import "./styles.css"; + import * as DataStore from "@api/DataStore"; import { showNotice } from "@api/Notices"; import { Settings, useSettings } from "@api/settings"; +import { classNameFactory } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { ErrorCard } from "@components/ErrorCard"; import { Flex } from "@components/Flex"; import { handleComponentFailed } from "@components/handleComponentFailed"; import { Badge } from "@components/PluginSettings/components"; import PluginModal from "@components/PluginSettings/PluginModal"; -import * as styles from "@components/PluginSettings/styles"; import { ChangeList } from "@utils/ChangeList"; import Logger from "@utils/Logger"; import { classes, LazyComponent, useAwaiter } from "@utils/misc"; @@ -36,6 +38,8 @@ import { Alerts, Button, Forms, Margins, Parser, React, Select, Switch, Text, Te import Plugins from "~plugins"; +const cl = classNameFactory("vc-plugins-"); + import { startDependenciesRecursive, startPlugin, stopPlugin } from "../../plugins"; const logger = new Logger("PluginSettings", "#a6d189"); @@ -145,7 +149,7 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe } return ( - + {plugin.name}{(isNew) && } -