make Popups use variable like Sidebar does

This commit is contained in:
TheMas3212 2022-01-09 07:25:41 +11:00
parent 84845ff9a2
commit 2e31dda75e
No known key found for this signature in database
GPG Key ID: 62A173A4FDA683CA

@ -302,25 +302,30 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
let mainPage = <Typography>Cannot load</Typography>; let mainPage = <Typography>Cannot load</Typography>;
let withSidebar = true; let withSidebar = true;
let withPopups = true;
switch (page) { switch (page) {
case Page.Recovery: { case Page.Recovery: {
mainPage = <RecoveryRoot router={Router} />; mainPage = <RecoveryRoot router={Router} />;
withSidebar = false; withSidebar = false;
withPopups = false;
break; break;
} }
case Page.BitVerse: { case Page.BitVerse: {
mainPage = <BitverseRoot flume={flume} enter={enterBitNode} quick={quick} />; mainPage = <BitverseRoot flume={flume} enter={enterBitNode} quick={quick} />;
withSidebar = false; withSidebar = false;
withPopups = false;
break break
} }
case Page.Infiltration: { case Page.Infiltration: {
mainPage = <InfiltrationRoot location={location} />; mainPage = <InfiltrationRoot location={location} />;
withSidebar = false; withSidebar = false;
withPopups = false;
break; break;
} }
case Page.BladeburnerCinematic: { case Page.BladeburnerCinematic: {
mainPage = <BladeburnerCinematic />; mainPage = <BladeburnerCinematic />;
withSidebar = false; withSidebar = false;
withPopups = false;
break; break;
} }
case Page.Work: { case Page.Work: {
@ -474,7 +479,6 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
} }
} }
const renderPopups = [Page.Recovery, Page.BitVerse, Page.Infiltration, Page.BladeburnerCinematic].includes(page);
return ( return (
<Context.Player.Provider value={player}> <Context.Player.Provider value={player}>
<Context.Router.Provider value={Router}> <Context.Router.Provider value={Router}>
@ -495,7 +499,7 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
</Box> </Box>
) : mainPage } ) : mainPage }
<Unclickable /> <Unclickable />
{renderPopups && ( {withPopups && (
<> <>
<LogBoxManager /> <LogBoxManager />
<AlertManager /> <AlertManager />