diff --git a/client/src/components/Modal.tsx b/client/src/components/Modal.tsx index c04e704..002f9be 100644 --- a/client/src/components/Modal.tsx +++ b/client/src/components/Modal.tsx @@ -8,7 +8,7 @@ const Modal = ({ children, show }: { children: ReactNode; show: boolean }) => { (show ? '' : ' hidden') } > -
+
{children}
); diff --git a/client/src/components/PopupMessage.tsx b/client/src/components/PopupMessage.tsx index 659d373..c940a62 100644 --- a/client/src/components/PopupMessage.tsx +++ b/client/src/components/PopupMessage.tsx @@ -2,6 +2,50 @@ import { useEffect, useState } from 'react'; import { FaEllipsisH } from 'react-icons/fa'; import Modal from './Modal'; +const DeleteModal = ({ + id, + showDelete, + setShowDelete, +}: { + id: string; + showDelete: boolean; + setShowDelete: (showDelete: boolean) => void; +}) => { + return ( + +
Voulez vous vraiment supprimer ce message ?
+ + +
+ ); +}; + +const EditModal = ({ + id, + showEdit, + setShowEdit, +}: { + id: string; + showEdit: boolean; + setShowEdit: (showEdit: boolean) => void; +}) => { + return ( + +
Modifier
+
+ ); +}; + const PopupMessage = ({ id }: { id: string }) => { const [show, setShow] = useState(false); const [showEdit, setShowEdit] = useState(false); @@ -9,7 +53,7 @@ const PopupMessage = ({ id }: { id: string }) => { useEffect(() => { const handleClick = (e: any) => { - if ((e.target.closest('.popup-btn') === null) || (e.target.closest('#messageId' + id) === null)) { + if (e.target.closest('#messageId' + id) === null) { setShow(false); } }; @@ -36,36 +80,26 @@ const PopupMessage = ({ id }: { id: string }) => {
- -
Modifier
-
- -
Voulez vous vraiment supprimer ce message ?
- - -
+ + ); };