From ac0f834155c9829949c698874ed3639697f52a5c Mon Sep 17 00:00:00 2001 From: V Date: Sat, 23 Sep 2023 03:15:07 +0200 Subject: [PATCH] Fix Plugin Settings on canary --- src/components/Icons.tsx | 40 ++++++++++++++++++------- src/components/PluginSettings/index.tsx | 9 +++--- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/components/Icons.tsx b/src/components/Icons.tsx index a24045ef..2aea67c6 100644 --- a/src/components/Icons.tsx +++ b/src/components/Icons.tsx @@ -28,8 +28,8 @@ interface BaseIconProps extends IconProps { interface IconProps extends SVGProps { className?: string; - height?: number; - width?: number; + height?: string | number; + width?: string | number; } function Icon({ height = 24, width = 24, className, children, viewBox, ...svgProps }: PropsWithChildren) { @@ -97,7 +97,7 @@ export function OpenExternalIcon(props: IconProps) { > @@ -121,9 +121,13 @@ export function InfoIcon(props: IconProps) { - + ); } @@ -139,8 +143,8 @@ export function OwnerCrownIcon(props: IconProps) { > @@ -159,8 +163,6 @@ export function ScreenshareIcon(props: IconProps) { > @@ -198,8 +200,24 @@ export function Microphone(props: IconProps) { className={classes(props.className, "vc-microphone")} viewBox="0 0 24 24" > - - + + ); } + +export function CogWheel(props: IconProps) { + return ( + + + + ); +} diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 3712f3de..22657e73 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -22,6 +22,7 @@ import * as DataStore from "@api/DataStore"; import { showNotice } from "@api/Notices"; import { Settings, useSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; +import { CogWheel, InfoIcon } from "@components/Icons"; import PluginModal from "@components/PluginSettings/PluginModal"; import { AddonCard } from "@components/VencordSettings/AddonCard"; import { SettingsTab } from "@components/VencordSettings/shared"; @@ -30,9 +31,9 @@ import { Logger } from "@utils/Logger"; import { Margins } from "@utils/margins"; import { classes, isObjectEmpty } from "@utils/misc"; import { openModalLazy } from "@utils/modal"; -import { LazyComponent, useAwaiter } from "@utils/react"; +import { useAwaiter } from "@utils/react"; import { Plugin } from "@utils/types"; -import { findByCode, findByPropsLazy } from "@webpack"; +import { findByPropsLazy } from "@webpack"; import { Alerts, Button, Card, Forms, Parser, React, Select, Text, TextInput, Toasts, Tooltip } from "@webpack/common"; import Plugins from "~plugins"; @@ -46,8 +47,6 @@ const logger = new Logger("PluginSettings", "#a6d189"); const InputStyles = findByPropsLazy("inputDefault", "inputWrapper"); const ButtonClasses = findByPropsLazy("button", "disabled", "enabled"); -const CogWheel = LazyComponent(() => findByCode("18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069")); -const InfoIcon = LazyComponent(() => findByCode("4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16")); function showErrorToast(message: string) { Toasts.show({ @@ -163,7 +162,7 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on } />