diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index fa4db9370..a0ee8de96 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -142,25 +142,6 @@ export function Root(props: IProps): React.ReactElement { if (currentScript === undefined) currentScript = null; } - const [dimensions, setDimensions] = useState({ - height: window.innerHeight, - width: window.innerWidth, - }); - useEffect(() => { - const debouncedHandleResize = debounce(function handleResize() { - setDimensions({ - height: window.innerHeight, - width: window.innerWidth, - }); - }, 250); - - window.addEventListener("resize", debouncedHandleResize); - - return () => { - window.removeEventListener("resize", debouncedHandleResize); - }; - }, []); - useEffect(() => { if (currentScript !== null) { updateRAM(currentScript.code); @@ -815,7 +796,6 @@ export function Root(props: IProps): React.ReactElement { // 5px padding for top of editor // 44px bottom tool bar + 16px margin // + vim bar 34px - const editorHeight = dimensions.height - (130 + (options.vim ? 34 : 0)); const tabsMaxWidth = 1640; const tabMargin = 5; const tabMaxWidth = filteredOpenScripts.length ? tabsMaxWidth / filteredOpenScripts.length - tabMargin : 0; @@ -951,7 +931,7 @@ export function Root(props: IProps): React.ReactElement { beforeMount={beforeMount} onMount={onMount} loading={Loading script editor!} - height={`${editorHeight}px`} + height={`calc(100vh - ${130 + (options.vim ? 34 : 0)}px)`} defaultLanguage="javascript" defaultValue={""} onChange={updateCode} diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index 281ef5006..3569b2ea7 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -104,10 +104,10 @@ const useStyles = makeStyles((theme: Theme) => "scrollbar-width": "none" /* for Firefox */, margin: theme.spacing(0), flexGrow: 1, - display: "block", padding: "8px", minHeight: "100vh", boxSizing: "border-box", + width: "1px", }, }), ); diff --git a/src/ui/LoadingScreen.tsx b/src/ui/LoadingScreen.tsx index 0bdd57090..9390360a1 100644 --- a/src/ui/LoadingScreen.tsx +++ b/src/ui/LoadingScreen.tsx @@ -2,10 +2,6 @@ import React, { useState, useEffect } from "react"; import CircularProgress from "@mui/material/CircularProgress"; import Typography from "@mui/material/Typography"; import Grid from "@mui/material/Grid"; -import Box from "@mui/material/Box"; -import { Theme } from "@mui/material/styles"; -import makeStyles from "@mui/styles/makeStyles"; -import createStyles from "@mui/styles/createStyles"; import { Terminal } from "../Terminal"; import { load } from "../db"; @@ -18,16 +14,7 @@ import { ActivateRecoveryMode } from "./React/RecoveryRoot"; import { hash } from "../hash/hash"; import { pushGameReady } from "../Electron"; -const useStyles = makeStyles((theme: Theme) => - createStyles({ - root: { - backgroundColor: theme.colors.backgroundprimary, - }, - }), -); - export function LoadingScreen(): React.ReactElement { - const classes = useStyles(); const [show, setShow] = useState(false); const [loaded, setLoaded] = useState(false); @@ -69,27 +56,23 @@ export function LoadingScreen(): React.ReactElement { doLoad(); }, []); - return ( - - {loaded ? ( - - ) : ( - - - - - - Loading Bitburner {version} - - {show && ( - - - If the game fails to load, consider killing all scripts - - - )} + return loaded ? ( + + ) : ( + + + + + + Loading Bitburner {version} + + {show && ( + + + If the game fails to load, consider killing all scripts + )} - + ); }