From a1a96b9e3c2b25e392ee257859f59df82b96aa02 Mon Sep 17 00:00:00 2001 From: 12944qwerty Date: Wed, 20 Sep 2023 16:44:08 -0400 Subject: [PATCH] lint --- src/renderer/coremods/settings/icons/Pin.tsx | 11 +-- .../coremods/settings/icons/Popout.tsx | 6 +- .../coremods/settings/icons/Settings.tsx | 6 +- .../coremods/settings/icons/Unpin.tsx | 24 ++++-- src/renderer/coremods/settings/icons/index.ts | 2 +- src/renderer/coremods/settings/index.tsx | 2 +- .../coremods/settings/pages/QuickCSS.css | 6 +- .../coremods/settings/pages/QuickCSS.tsx | 77 +++++++++++-------- 8 files changed, 85 insertions(+), 49 deletions(-) diff --git a/src/renderer/coremods/settings/icons/Pin.tsx b/src/renderer/coremods/settings/icons/Pin.tsx index 89a893471..edaa8d00f 100644 --- a/src/renderer/coremods/settings/icons/Pin.tsx +++ b/src/renderer/coremods/settings/icons/Pin.tsx @@ -1,10 +1,11 @@ import { MouseEventHandler } from "react"; export default (props: { onClick?: MouseEventHandler }): React.ReactElement => ( - - + + ); diff --git a/src/renderer/coremods/settings/icons/Popout.tsx b/src/renderer/coremods/settings/icons/Popout.tsx index 419028b63..a192ba384 100644 --- a/src/renderer/coremods/settings/icons/Popout.tsx +++ b/src/renderer/coremods/settings/icons/Popout.tsx @@ -1,7 +1,11 @@ import { MouseEventHandler } from "react"; export default (props: { onClick?: MouseEventHandler }): React.ReactElement => ( - + ); diff --git a/src/renderer/coremods/settings/icons/Settings.tsx b/src/renderer/coremods/settings/icons/Settings.tsx index b2e701fc7..a9e57441c 100644 --- a/src/renderer/coremods/settings/icons/Settings.tsx +++ b/src/renderer/coremods/settings/icons/Settings.tsx @@ -1,7 +1,11 @@ import { MouseEventHandler } from "react"; export default (props: { onClick?: MouseEventHandler }): React.ReactElement => ( - + {/* Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. */} diff --git a/src/renderer/coremods/settings/icons/Unpin.tsx b/src/renderer/coremods/settings/icons/Unpin.tsx index 37511a762..465897e08 100644 --- a/src/renderer/coremods/settings/icons/Unpin.tsx +++ b/src/renderer/coremods/settings/icons/Unpin.tsx @@ -1,14 +1,24 @@ import { MouseEventHandler } from "react"; export default (props: { onClick?: MouseEventHandler }): React.ReactElement => ( - - - + + + - - - - + + + + ); diff --git a/src/renderer/coremods/settings/icons/index.ts b/src/renderer/coremods/settings/icons/index.ts index c704d147c..3b99bb216 100644 --- a/src/renderer/coremods/settings/icons/index.ts +++ b/src/renderer/coremods/settings/icons/index.ts @@ -17,5 +17,5 @@ export default { Trash, Popout, Pin, - Unpin + Unpin, }; diff --git a/src/renderer/coremods/settings/index.tsx b/src/renderer/coremods/settings/index.tsx index 306ef5b06..772fb20e4 100644 --- a/src/renderer/coremods/settings/index.tsx +++ b/src/renderer/coremods/settings/index.tsx @@ -4,7 +4,7 @@ import { Injector } from "@replugged"; import { filters, waitForModule } from "src/renderer/modules/webpack"; import type { Section as SectionType } from "src/types/coremods/settings"; import { Divider, Header, Section, insertSections, settingsTools } from "./lib"; -import { General, Plugins, ConnectedQuickCSS, Themes, Updater } from "./pages"; +import { ConnectedQuickCSS, General, Plugins, Themes, Updater } from "./pages"; const injector = new Injector(); diff --git a/src/renderer/coremods/settings/pages/QuickCSS.css b/src/renderer/coremods/settings/pages/QuickCSS.css index cd121cef7..a229dfb58 100644 --- a/src/renderer/coremods/settings/pages/QuickCSS.css +++ b/src/renderer/coremods/settings/pages/QuickCSS.css @@ -2,7 +2,7 @@ color: var(--text-normal); } -#replugged-quickcss-wrapper[data-popout=true] { +#replugged-quickcss-wrapper[data-popout="true"] { width: 100% !important; } @@ -37,7 +37,7 @@ } /* TODO: Fix the height not working in popout */ -#replugged-quickcss-wrapper[data-popout=true] .cm-scroller { +#replugged-quickcss-wrapper[data-popout="true"] .cm-scroller { max-height: 95vh; } @@ -63,7 +63,7 @@ background-color: var(--background-secondary); } /* Why do these have to be different in different windows.. */ -#replugged-quickcss-wrapper[data-popout=true] .replugged-quickcss-header { +#replugged-quickcss-wrapper[data-popout="true"] .replugged-quickcss-header { height: 16px; } diff --git a/src/renderer/coremods/settings/pages/QuickCSS.tsx b/src/renderer/coremods/settings/pages/QuickCSS.tsx index efbfc4442..ccbc5bf96 100644 --- a/src/renderer/coremods/settings/pages/QuickCSS.tsx +++ b/src/renderer/coremods/settings/pages/QuickCSS.tsx @@ -43,10 +43,10 @@ const closePopout = webpack.getFunctionBySource(PopoutModule, "POPOUT_WINDOW_CLO ) => void; // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style -const setAlwaysOnTop = webpack.getFunctionBySource(PopoutModule, "POPOUT_WINDOW_SET_ALWAYS_ON_TOP") as ( - key: string, - alwaysOnTop: boolean, -) => void; +const setAlwaysOnTop = webpack.getFunctionBySource( + PopoutModule, + "POPOUT_WINDOW_SET_ALWAYS_ON_TOP", +) as (key: string, alwaysOnTop: boolean) => void; // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style const PopoutWindowStore = webpack.getByStoreName("PopoutWindowStore") as Store & { @@ -219,7 +219,7 @@ const QuickCSS = (props: { popout: boolean } & Record): React.R }, []); } - const [ alwaysOnTop, setAlwaysOnTop_ ] = React.useState(props.popoutOnTop); + const [alwaysOnTop, setAlwaysOnTop_] = React.useState(props.popoutOnTop); return ( <> @@ -260,28 +260,42 @@ const QuickCSS = (props: { popout: boolean } & Record): React.R - {props.popout ? - {alwaysOnTop ? { - setAlwaysOnTop('DISCORD_REPLUGGED_QUICKCSS', false); - setAlwaysOnTop_(false); - }} /> : { - setAlwaysOnTop('DISCORD_REPLUGGED_QUICKCSS', true); - setAlwaysOnTop_(true); - }} /> - } - : - { - openPopout( - "DISCORD_REPLUGGED_QUICKCSS", - () => ( - - - - ), - {}, - ); - }} /> - } + {props.popout ? ( + + {alwaysOnTop ? ( + { + setAlwaysOnTop("DISCORD_REPLUGGED_QUICKCSS", false); + setAlwaysOnTop_(false); + }} + /> + ) : ( + { + setAlwaysOnTop("DISCORD_REPLUGGED_QUICKCSS", true); + setAlwaysOnTop_(true); + }} + /> + )} + + ) : ( + + { + openPopout( + "DISCORD_REPLUGGED_QUICKCSS", + () => ( + + + + ), + {}, + ); + }} + /> + + )}
@@ -290,10 +304,13 @@ const QuickCSS = (props: { popout: boolean } & Record): React.R ); }; -export const ConnectedQuickCSS = flux.connectStores<{ popout: boolean }, { popout: boolean; isPopoutOpen: boolean }>([PopoutWindowStore], (props) => { +export const ConnectedQuickCSS = flux.connectStores< + { popout: boolean }, + { popout: boolean; isPopoutOpen: boolean } +>([PopoutWindowStore], (props) => { return { isPopoutOpen: PopoutWindowStore.getWindowOpen("DISCORD_REPLUGGED_QUICKCSS"), popoutOnTop: PopoutWindowStore.getIsAlwaysOnTop("DISCORD_REPLUGGED_QUICKCSS"), - ...props - } + ...props, + }; })(QuickCSS);