From 257dcc758befa7dc3292c6aae5dfb000e8d821b9 Mon Sep 17 00:00:00 2001 From: hakyoung12 Date: Thu, 17 Oct 2024 13:49:35 +0900 Subject: [PATCH] =?UTF-8?q?[KAN-132]=20feat:=20=EB=AA=A8=EC=9E=84=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=20=EC=9E=AC=ED=99=95=EC=9D=B8=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BottomFloatingBar/ParticipationButton.tsx | 20 ++++++++++++++----- .../components/Modal/CancelGatheringModal.tsx | 17 +++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) 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 = ({ {/* 버튼 그룹 */}
-
-