add state for mobile layout

This commit is contained in:
Jon Eugster
2023-07-29 02:44:57 +02:00
parent e8eff166e1
commit ae6ffa7d01
+4
View File
@@ -59,6 +59,8 @@ function LevelIcon({ worldId, levelId, position, completed, available }) {
function Welcome() { function Welcome() {
const navigate = useNavigate(); const navigate = useNavigate();
const [mobileLayout, setModileLayout] = useState(false)
const gameId = React.useContext(GameIdContext) const gameId = React.useContext(GameIdContext)
const gameInfo = useGetGameInfoQuery({game: gameId}) const gameInfo = useGetGameInfoQuery({game: gameId})
@@ -187,6 +189,8 @@ function Welcome() {
<Box display="flex" alignItems="center" justifyContent="center" sx={{ height: "calc(100vh - 64px)" }}> <Box display="flex" alignItems="center" justifyContent="center" sx={{ height: "calc(100vh - 64px)" }}>
<CircularProgress /> <CircularProgress />
</Box> </Box>
: mobileLayout ?
<></>
: :
<Split className="welcome" minSize={0} snapOffset={200} sizes={[40, 35, 25]}> <Split className="welcome" minSize={0} snapOffset={200} sizes={[40, 35, 25]}>
<div className="column"> <div className="column">