-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.tsx
More file actions
27 lines (24 loc) · 826 Bytes
/
Copy pathApp.tsx
File metadata and controls
27 lines (24 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"use client";
import React, { useEffect } from "react";
import { Game } from "./components/Game";
import { StartScreen } from "./components/StartScreen";
import { useGameStore } from "./store";
function App() {
const gameStarted = useGameStore((state) => state.gameStarted);
useEffect(() => {
// Prevent scrolling, especially important on mobile
document.body.classList.add("overflow-hidden", "touch-none");
document.documentElement.classList.add("overflow-hidden", "h-full");
// Cleanup when component unmounts
return () => {
document.body.classList.remove("overflow-hidden", "touch-none");
document.documentElement.classList.remove("overflow-hidden", "h-full");
};
}, []);
return (
<div className="w-full h-screen">
{gameStarted ? <Game /> : <StartScreen />}
</div>
);
}
export default App;