diff --git a/src/pages/Complete/CompleteWriting.tsx b/src/pages/Complete/CompleteWriting.tsx index b66f451..3df7312 100644 --- a/src/pages/Complete/CompleteWriting.tsx +++ b/src/pages/Complete/CompleteWriting.tsx @@ -38,7 +38,8 @@ function CompleteWriting() { ); const [isLiked, setIsLiked] = useState(false); const [likesCount, setLikesCount] = useState(0); - const [showModal, setShowModal] = useState(false); + const [showShareModal, setShowShareModal] = useState(false); + const [showDeleteModal, setShowDeleteModal] = useState(false); const fetchRetrospective = async () => { try { @@ -144,15 +145,16 @@ function CompleteWriting() { }; const handleShareClick = () => { - setShowModal(true); + setShowShareModal(true); }; const handleDeleteClick = () => { - setShowModal(true); + setShowDeleteModal(true); }; - const handleOverlayClick = () => { - setShowModal(false); + const closeModals = () => { + setShowShareModal(false); + setShowDeleteModal(false); }; return ( @@ -174,7 +176,7 @@ function CompleteWriting() {
Share
- {/* 유저의 글에만 보임 : 수정, 삭제 */} + {/* 유저의 글에만 보임: 수정, 삭제 */} {retrospective && retrospective.owner && ( <>
@@ -194,12 +196,19 @@ function CompleteWriting() {
- {showModal && ( - <> - setShowModal(false)} /> - setShowModal(false)} /> - - + {showShareModal && ( + setShowShareModal(false)} /> + )} + {showDeleteModal && ( + setShowDeleteModal(false)} /> + )} + {(showShareModal || showDeleteModal) && ( + { + setShowShareModal(false); + setShowDeleteModal(false); + }} + /> )} );