Integration the StateContext into the App.jsx

This commit is contained in:
Mathias Wagner 2023-06-09 02:23:52 +02:00
parent 141644c6d2
commit 1bfb459d56

View File

@ -1,9 +1,15 @@
import Home from "./pages/Home";
import {useContext} from "react";
import {StateContext} from "@/common/contexts/StateContext";
import GameCreation from "@/pages/GameCreation";
const App = () => {
const {currentState} = useContext(StateContext);
return (
<>
<Home />
{currentState === "Home" && <Home />}
{currentState === "GameCreation" && <GameCreation />}
</>
)
}