refining with cross

This commit is contained in:
Antoine M 2024-02-21 11:06:50 +01:00
parent 78582036e3
commit b445a1e2cd

View File

@ -1,17 +1,17 @@
import React from "react"; import React from "react";
import { useGame } from "../../hooks/useGame"; import { useGame } from "../../hooks/useGame";
import Modal from "../../components/ui/Modal.jsx"; import Modal from "../../components/ui/Modal.jsx";
import closeIcon from "../../assets/img/icons/icon-cross.svg";
export default function GameModal() { export default function GameModal() {
const { currentGameModal, setCurrentGameModal } = useGame(); const { currentGameModal, setCurrentGameModal } = useGame();
if (!currentGameModal) return null; if (!currentGameModal) return null;
return ( return (
<Modal className='game-modal' onClose={() => setCurrentGameModal(null)}> <Modal className='game-modal' open={currentGameModal} onClose={() => setCurrentGameModal(null)}>
<button className='game-modal__close-button' onClick={() => setCurrentGameModal(null)}> <button className='game-modal__close-button' onClick={() => setCurrentGameModal(null)}>
Close <img className='close-icon' src={closeIcon} alt='close' />
</button> </button>
{currentGameModal} {currentGameModal}
</Modal> </Modal>
); );