introducing special GameModal component to be used in the game

This commit is contained in:
Antoine M 2024-02-13 19:26:04 +01:00
parent 5fae2a54b3
commit 3a14aa7f9d

View File

@ -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 (
<Modal className='game-modal' onClose={() => setCurrentGameModal(null)}>
<button className='game-modal__close-button' onClick={() => setCurrentGameModal(null)}>
Close
</button>
{currentGameModal}
</Modal>
);
}