Skip to content

Commit

Permalink
fix (and now check) hide ui
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Jun 1, 2024
1 parent 9958008 commit c5e636f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/reactUi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ const InGameUi = () => {
return <>
<RobustPortal to={document.querySelector('#ui-root')}>
{/* apply scaling */}
<DeathScreenProvider />
<DebugOverlay />
<MobileTopButtons />
<PlayerListOverlayProvider />
<ChatProvider />
<SoundMuffler />
<div style={{ display: showUI ? 'block' : 'none' }}>
<DeathScreenProvider />
<DebugOverlay />
<MobileTopButtons />
<PlayerListOverlayProvider />
<ChatProvider />
<SoundMuffler />
<TitleProvider />
<ScoreboardProvider />
<IndicatorEffectsProvider />
<Crosshair />
<TouchAreasControlsProvider />
</div>
<TouchAreasControlsProvider />

<PauseScreen />
<div style={{ display: showUI ? 'block' : 'none' }}>
Expand All @@ -129,7 +129,7 @@ const InGameUi = () => {
</PerComponentErrorBoundary>
<RobustPortal to={document.body}>
{/* because of z-index */}
<TouchControls />
{showUI && <TouchControls />}
<GlobalSearchInput />
</RobustPortal>
</>
Expand All @@ -147,8 +147,6 @@ const WidgetDisplay = ({ name, Component }) => {
}

const App = () => {
const { showUI } = useSnapshot(miscUiState)

return <div>
<ButtonAppProvider>
<RobustPortal to={document.body}>
Expand All @@ -160,7 +158,7 @@ const App = () => {
<div></div>
</RobustPortal>
<EnterFullscreenButton />
{showUI && <InGameUi />}
<InGameUi />
<RobustPortal to={document.querySelector('#ui-root')}>
<AllWidgets />
<SingleplayerProvider />
Expand Down

0 comments on commit c5e636f

Please sign in to comment.