Merge pull request #1512 from danielyxie/dev

Improve text editor height
This commit is contained in:
hydroflame 2021-10-15 16:16:30 -04:00 committed by GitHub
commit 57ab4a029e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -315,7 +315,9 @@ export function Root(props: IProps): React.ReactElement {
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
loadThemes(monaco);
}
const h = window.innerHeight;
// 370px 71%, 725px 85.1%, 1085px 90%, 1300px 91.7%
// fuck around in desmos until you find a function
const p = 11000 / -window.innerHeight + 100;
return (
<>
<Box display="flex" flexDirection="row" alignItems="center">
@ -337,7 +339,7 @@ export function Root(props: IProps): React.ReactElement {
beforeMount={beforeMount}
onMount={onMount}
loading={<Typography>Loading script editor!</Typography>}
height={90 - h / 100 + "%"}
height={p + "%"}
defaultLanguage="javascript"
defaultValue={code}
onChange={updateCode}