handling specific gameId

This commit is contained in:
Antoine M 2024-03-18 11:12:29 +01:00
parent a346de3ad8
commit c201b7eca9

View File

@ -1,3 +1,4 @@
import { useParams } from "react-router-dom";
import { GameContextProvider } from "../context/GameContext.js";
import GameContainer from "../components/game/GameContainer.jsx";
@ -8,6 +9,8 @@ import GameModal from "../components/game/GameModal.jsx";
import AnimatedPage from "../components/AnimatedPage.jsx";
export default function Game() {
const { id } = useParams();
const gameId = id || "latest";
return (
<>
<AnimatedPage className='page-container page-container--play'>
@ -16,7 +19,7 @@ export default function Game() {
<Logo />
<GameModal />
<Tutorials />
<GameContainer gameId={"latest"} />
<GameContainer gameId={gameId} />
</div>
</GameContextProvider>
</AnimatedPage>