diff --git a/src/app/components/BottomFloatingBar/ParticipationButton.tsx b/src/app/components/BottomFloatingBar/ParticipationButton.tsx index 3bb0ae9c..c468e1d2 100644 --- a/src/app/components/BottomFloatingBar/ParticipationButton.tsx +++ b/src/app/components/BottomFloatingBar/ParticipationButton.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { UserData } from '@/types/client.type'; @@ -10,6 +10,7 @@ import useCancelGathering from '@/hooks/useCancelGathering'; import useParticipation from '@/hooks/useParticipation'; import { GatheringParticipantsType } from '@/types/data.type'; import Popup from '../Popup/Popup'; +import CancelGatheringModal from '../Modal/CancelGatheringModal'; interface ParticipationButtonProps { isHost: boolean; @@ -31,6 +32,7 @@ const ParticipationButton = ({ participantsData, }: ParticipationButtonProps) => { const router = useRouter(); + const [isModalOpen, setIsModalOpen] = useState(false); const params = useParams(); const { copyUrlToClipboard } = useCopyUrlToClipboard(); @@ -90,10 +92,18 @@ const ParticipationButton = ({ const disabled = isRegistrationEnded; // 마감일이 지난 경우 버튼 비활성화 return ( -
- {renderButton('취소하기', 'white', cancelGathering)} - {renderButton('공유하기', 'default', copyUrlToClipboard, disabled)} -
+ <> +
+ {renderButton('취소하기', 'white', () => setIsModalOpen(true))} + {renderButton('공유하기', 'default', copyUrlToClipboard, disabled)} +
+ {isModalOpen && ( + setIsModalOpen(false)} + /> + )} + ); } diff --git a/src/app/components/Modal/CancelGatheringModal.tsx b/src/app/components/Modal/CancelGatheringModal.tsx index 15c7250a..adf3cf3e 100644 --- a/src/app/components/Modal/CancelGatheringModal.tsx +++ b/src/app/components/Modal/CancelGatheringModal.tsx @@ -6,13 +6,14 @@ import ModalHeader from './ModalHeader'; interface CancelGatheringModalProps { onClose: () => void; - onSubmit?: () => void; + onClick?: () => void; } const CancelGatheringModal = ({ onClose, - onSubmit, + onClick, }: CancelGatheringModalProps) => { + console.log('모달'); return (
@@ -24,18 +25,10 @@ const CancelGatheringModal = ({ {/* 버튼 그룹 */}
-
-