UI: Memoize character overview (#247)

This commit is contained in:
David Walker
2022-12-21 15:27:51 -08:00
committed by GitHub
parent addcee73fc
commit 149d687fd6
3 changed files with 258 additions and 276 deletions
+11 -5
View File
@@ -432,11 +432,17 @@ export function GameRoot(): React.ReactElement {
<BypassWrapper content={bypassGame ? mainPage : null}>
<SnackbarProvider>
<Overview mode={ITutorial.isRunning ? "tutorial" : "overview"}>
{!ITutorial.isRunning ? (
<CharacterOverview save={() => saveObject.saveGame()} killScripts={killAllScripts} />
) : (
<InteractiveTutorialRoot />
)}
{(parentOpen) =>
!ITutorial.isRunning ? (
<CharacterOverview
parentOpen={parentOpen}
save={() => saveObject.saveGame()}
killScripts={killAllScripts}
/>
) : (
<InteractiveTutorialRoot />
)
}
</Overview>
{withSidebar ? (
<Box display="flex" flexDirection="row" width="100%">