This commit is contained in:
Alexander Bentkamp
2023-11-30 10:51:03 +01:00
parent 07b6525c58
commit bae360874c
7 changed files with 158 additions and 178 deletions
+5
View File
@@ -10,6 +10,7 @@ import './css/reset.css';
import './css/app.css';
import { MobileContext } from './components/infoview/context';
import { useWindowDimensions } from './window_width';
import { connection } from './connection';
export const GameIdContext = React.createContext<string>(undefined);
@@ -19,6 +20,10 @@ function App() {
const {width, height} = useWindowDimensions()
const [mobile, setMobile] = React.useState(width < 800)
React.useEffect(() => {
connection.startLeanClient(gameId);
}, [gameId])
return (
<div className="app">
<GameIdContext.Provider value={gameId}>