From 61e88fc5f986da1787d7a9dde6c572f78a80d9b1 Mon Sep 17 00:00:00 2001 From: Hakase Date: Sun, 8 Sep 2024 09:31:16 +0200 Subject: [PATCH] fix styling assumptions and optimize sentry plugin --- desktop/index.js | 4 ++-- .../_services/lightquark/nav/Aviebox.jsx | 5 ----- .../lightquark/nav/LightquarkChannelList.jsx | 4 ---- .../nav/LightquarkChannelList.module.css | 2 +- .../lightquark/nav/QuarkHeader.module.css | 1 - .../_services/lightquark/settings/SettingsID.jsx | 2 +- src/components/nav/UserSettingsSidebar.jsx | 4 ++-- src/components/nyafile/NyafileImage.jsx | 14 +++++++------- src/routes/QuarkView.jsx | 4 +++- src/routes/QuarkView.module.css | 6 ++++++ vite.config.js | 9 ++++++++- 11 files changed, 30 insertions(+), 25 deletions(-) diff --git a/desktop/index.js b/desktop/index.js index ce65d3f..0cdb502 100644 --- a/desktop/index.js +++ b/desktop/index.js @@ -8,7 +8,7 @@ import { dirname } from 'path'; import { fileURLToPath } from 'url'; import os from "node:os"; import * as path from "node:path"; -import installExtension, {REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS} from "@tomjs/electron-devtools-installer"; +import installExtension, {REACT_DEVELOPER_TOOLS} from "@tomjs/electron-devtools-installer"; const __dirname = fileURLToPath(dirname(import.meta.url)); const gamePLUS = new Worker(path.join(__dirname, 'gameplus.js')); @@ -57,7 +57,7 @@ const createWindow = () => { autoUpdater.checkForUpdates(); }, 60000) } else { - installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS]) + installExtension([REACT_DEVELOPER_TOOLS]) } win.loadURL( diff --git a/src/components/_services/lightquark/nav/Aviebox.jsx b/src/components/_services/lightquark/nav/Aviebox.jsx index c07387e..710bcb8 100644 --- a/src/components/_services/lightquark/nav/Aviebox.jsx +++ b/src/components/_services/lightquark/nav/Aviebox.jsx @@ -1,11 +1,6 @@ import styles from './Aviebox.module.css'; -import {useContext} from "react"; -import {AppContext} from "../../../../contexts/AppContext.js"; import ProfilePicture from "../../../dialogs/ProfilePicture.jsx"; -import localForage from "localforage"; -import {useNavigate} from "react-router-dom"; import NiceModal from "@ebay/nice-modal-react"; -import JoinQuarkModal from "../../../modals/JoinQuarkModal.jsx"; import SettingsView from "../../../../routes/SettingsView.jsx"; import UserSettingsSidebar from "../../../nav/UserSettingsSidebar.jsx"; import UserSettingsArea from "../../../nav/UserSettingsArea.jsx"; diff --git a/src/components/_services/lightquark/nav/LightquarkChannelList.jsx b/src/components/_services/lightquark/nav/LightquarkChannelList.jsx index e60147d..a9cfb9f 100644 --- a/src/components/_services/lightquark/nav/LightquarkChannelList.jsx +++ b/src/components/_services/lightquark/nav/LightquarkChannelList.jsx @@ -1,9 +1,5 @@ -import {useContext, useEffect, useState} from "react"; -import LQ from "../../../../util/LQ.js"; -import {useParams} from "react-router-dom"; import LightquarkChannel from "./LightquarkChannel.jsx"; import styles from "./LightquarkChannelList.module.css"; -import {AppContext} from "../../../../contexts/AppContext.js"; export default function LightquarkChannelList({quark, demo}) { return
diff --git a/src/components/_services/lightquark/nav/LightquarkChannelList.module.css b/src/components/_services/lightquark/nav/LightquarkChannelList.module.css index bf789dc..87a2594 100644 --- a/src/components/_services/lightquark/nav/LightquarkChannelList.module.css +++ b/src/components/_services/lightquark/nav/LightquarkChannelList.module.css @@ -1,3 +1,3 @@ .channelList { - background: var(--background-color-less) + } \ No newline at end of file diff --git a/src/components/_services/lightquark/nav/QuarkHeader.module.css b/src/components/_services/lightquark/nav/QuarkHeader.module.css index 56970f6..3679690 100644 --- a/src/components/_services/lightquark/nav/QuarkHeader.module.css +++ b/src/components/_services/lightquark/nav/QuarkHeader.module.css @@ -3,6 +3,5 @@ justify-content: space-between; padding: 0.5em; - background-color: var(--background-color-less); border-bottom: 2px dashed var(--background-color-min); } \ No newline at end of file diff --git a/src/components/_services/lightquark/settings/SettingsID.jsx b/src/components/_services/lightquark/settings/SettingsID.jsx index f7653e3..d04b7bf 100644 --- a/src/components/_services/lightquark/settings/SettingsID.jsx +++ b/src/components/_services/lightquark/settings/SettingsID.jsx @@ -46,7 +46,7 @@ export default function SettingsID({quarkId}) { return
-
diff --git a/src/components/nav/UserSettingsSidebar.jsx b/src/components/nav/UserSettingsSidebar.jsx index 88cb853..cfdae1d 100644 --- a/src/components/nav/UserSettingsSidebar.jsx +++ b/src/components/nav/UserSettingsSidebar.jsx @@ -51,8 +51,8 @@ export default function UserSettingsSidebar({area, setArea}) {
- - + +
} \ No newline at end of file diff --git a/src/components/nyafile/NyafileImage.jsx b/src/components/nyafile/NyafileImage.jsx index 36b2b04..e6b1dce 100644 --- a/src/components/nyafile/NyafileImage.jsx +++ b/src/components/nyafile/NyafileImage.jsx @@ -4,33 +4,33 @@ import {AppContext} from "../../contexts/AppContext.js"; /** * A wrapper for that allows specifying a Nyafile path in the src instead. * TODO: Fix this. Not ported. Bad. + * @param src - The path to the image in the Nyafile. * @param props - The props of the component to pass down to the , provided by React. * @returns {JSX.Element} - The tag with the image from the Nyafile as the src. * @constructor */ -export default function NyafileImage(props) { +export default function NyafileImage({src, inlinesvg, ...props}) { let appContext = useContext(AppContext); - const { src, ...otherProps } = props; const [image, setImage] = useState(""); const [svg, setSvg] = useState(null); useEffect(() => { async function getDataUrl() { - const fetchedImage = await appContext.nyafile.getAssetDataUrl(props.src); - if(fetchedImage.startsWith("data:image/svg") && props.inlinesvg) { + const fetchedImage = await appContext.nyafile.getAssetDataUrl(src); + if(fetchedImage.startsWith("data:image/svg") && inlinesvg) { setSvg(atob(fetchedImage.replace("data:image/svg+xml;base64,", ''))) } else { setImage(fetchedImage) } } getDataUrl(); - }, [appContext.nyafile, appContext.nyafile.defaultFile, appContext.nyafile.nyaFile, props.src]); + }, [appContext.nyafile, appContext.nyafile.defaultFile, appContext.nyafile.nyaFile, src]); // noinspection HtmlRequiredAltAttribute if(!svg) return ( - + ) return ( -
+
) } \ No newline at end of file diff --git a/src/routes/QuarkView.jsx b/src/routes/QuarkView.jsx index ee4a10c..35550d8 100644 --- a/src/routes/QuarkView.jsx +++ b/src/routes/QuarkView.jsx @@ -18,7 +18,9 @@ export default function QuarkView() { {isLoading ? null : <> } - +
+ +
diff --git a/src/routes/QuarkView.module.css b/src/routes/QuarkView.module.css index 02d1490..8ccb177 100644 --- a/src/routes/QuarkView.module.css +++ b/src/routes/QuarkView.module.css @@ -11,6 +11,8 @@ display: flex; flex-direction: column; justify-content: space-between; + + background: var(--background-color-less); } .channelListWrap > div[class*="_channelList_"] { @@ -22,4 +24,8 @@ flex-direction: row; flex-grow: 1; background-color: var(--background-color-max); +} + +.avieboxWrap { + margin-top: auto; } \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 8e69abb..a1fa6a0 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,7 +14,14 @@ export default defineConfig({ plugins: [ react(), basicSsl(), - sentryVitePlugin({}), + sentryVitePlugin({ + bundleSizeOptimizations: { + excludeDebugStatements: true, + excludeReplayIframe: true, + excludeReplayShadowDom: true + }, + reactComponentAnnotation: { enabled: true } + }), ], test: { globals: true,