Skip to content

Commit eb6c5f3

Browse files
author
Oskar Widmark
committed
fix: hide app properly when in portrait
1 parent 8845d18 commit eb6c5f3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/AppWithSound.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { gainToDb } from 'tone';
66
import { DEFAULT_SOUND_TYPE, DEFAULT_SOUND_VOLUME } from './constants';
77
import { RotationRequest } from './RotationRequest';
88
import { useIsPortrait } from './hooks/useIsPortrait';
9+
import { Box } from '@mui/material';
910

1011
export function AppWithSound(): React.ReactElement {
1112
const [soundType, setSoundType] =
@@ -23,13 +24,15 @@ export function AppWithSound(): React.ReactElement {
2324
return (
2425
<>
2526
{isPortrait && <RotationRequest />}
26-
<App
27-
playSound={play}
28-
stopSounds={stop}
29-
soundType={soundType}
30-
setSoundType={setSoundType}
31-
setVolume={setVolume}
32-
/>
27+
<Box sx={{ display: isPortrait ? 'none' : 'block' }}>
28+
<App
29+
playSound={play}
30+
stopSounds={stop}
31+
soundType={soundType}
32+
setSoundType={setSoundType}
33+
setVolume={setVolume}
34+
/>
35+
</Box>
3336
</>
3437
);
3538
}

0 commit comments

Comments
 (0)