introducing special GameModal component to be used in the game
This commit is contained in:
parent
5fae2a54b3
commit
3a14aa7f9d
18
src/components/game/GameModal.jsx
Normal file
18
src/components/game/GameModal.jsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user