From 3a14aa7f9d2a4f0a7ba95b37fca0d948864b68ec Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 13 Feb 2024 19:26:04 +0100 Subject: [PATCH] introducing special GameModal component to be used in the game --- src/components/game/GameModal.jsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/components/game/GameModal.jsx diff --git a/src/components/game/GameModal.jsx b/src/components/game/GameModal.jsx new file mode 100644 index 0000000..046e0d4 --- /dev/null +++ b/src/components/game/GameModal.jsx @@ -0,0 +1,18 @@ +import React from "react"; +import { useGame } from "../../hooks/useGame"; +import Modal from "../../components/ui/Modal.jsx"; + +export default function GameModal() { + const { currentGameModal, setCurrentGameModal } = useGame(); + if (!currentGameModal) return null; + + return ( + setCurrentGameModal(null)}> + + + {currentGameModal} + + ); +}