From 2c95c5b561ad981e0012e9363bd398a6326a2f67 Mon Sep 17 00:00:00 2001 From: jaeml06 Date: Tue, 2 Dec 2025 15:59:59 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=ED=95=98=EB=82=98=EC=9D=98=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EC=9C=BC=EB=A1=9C=EB=8F=84=20=EB=8C=80?= =?UTF-8?q?=EC=9D=91=EB=90=98=EB=8F=84=EB=A1=9D=20DialogModal=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogModal/DialogModal.tsx | 89 +++++++++++----------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/src/components/DialogModal/DialogModal.tsx b/src/components/DialogModal/DialogModal.tsx index eecb3175..f042d9ad 100644 --- a/src/components/DialogModal/DialogModal.tsx +++ b/src/components/DialogModal/DialogModal.tsx @@ -1,16 +1,14 @@ import { PropsWithChildren } from 'react'; +interface DialogButton { + text: string; + onClick: () => void; + isBold?: boolean; +} + interface DialogModalProps extends PropsWithChildren { - left: { - text: string; - onClick: () => void; - isBold?: boolean; - }; - right: { - text: string; - onClick: () => void; - isBold?: boolean; - }; + left?: DialogButton; + right?: DialogButton; } export default function DialogModal({ @@ -18,12 +16,11 @@ export default function DialogModal({ left, right, }: DialogModalProps) { - if (left.isBold === undefined || null) { - left.isBold = false; - } - if (right.isBold === undefined || null) { - right.isBold = false; - } + const leftIsBold = left?.isBold ?? false; + const rightIsBold = right?.isBold ?? false; + const hasButtons = Boolean(left || right); + const isSingleButton = Boolean(left && !right) || Boolean(right && !left); + const buttonWidthClass = isSingleButton ? 'w-full' : 'w-1/2'; return (
-
- {/** Left button */} - + {hasButtons && ( + <> +
+
+ {left && ( + + )} - {/** Right button */} - -
+ {right && ( + + )} +
+ + )}
); } From 1d6f11ba558a3cc60fcd5973c081ef3b5e735c47 Mon Sep 17 00:00:00 2001 From: jaeml06 Date: Tue, 2 Dec 2025 16:00:25 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=ED=88=AC=ED=91=9C=20=EC=A2=85?= =?UTF-8?q?=EB=A3=8C=20=EC=8B=9C=20=ED=95=9C=EB=B2=88=20=EB=8D=94=20?= =?UTF-8?q?=EB=AC=BC=EC=96=B4=EB=B3=B4=EA=B8=B0=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/DebateVotePage/DebateVotePage.tsx | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/page/DebateVotePage/DebateVotePage.tsx b/src/page/DebateVotePage/DebateVotePage.tsx index 70061bdc..515dbe47 100644 --- a/src/page/DebateVotePage/DebateVotePage.tsx +++ b/src/page/DebateVotePage/DebateVotePage.tsx @@ -6,6 +6,8 @@ import { useGetPollInfo } from '../../hooks/query/useGetPollInfo'; import ErrorIndicator from '../../components/ErrorIndicator/ErrorIndicator'; import useFetchEndPoll from '../../hooks/mutations/useFetchEndPoll'; import GoToDebateEndButton from '../../components/GoToDebateEndButton/GoToDebateEndButton'; +import { useModal } from '../../hooks/useModal'; +import DialogModal from '../../components/DialogModal/DialogModal'; export default function DebateVotePage() { const navigate = useNavigate(); const baseUrl = @@ -37,7 +39,13 @@ export default function DebateVotePage() { refetch, isRefetchError, } = useGetPollInfo(pollId, { refetchInterval: 5000, enabled: isArgsValid }); + const { openModal, closeModal, ModalWrapper } = useModal(); const { mutate } = useFetchEndPoll(handleGoToResult); + const handleConfirmEnd = () => { + if (!isArgsValid) return; + mutate(pollId); + closeModal(); + }; const participants = data?.voterNames; const isLoading = isFetching || isRefetching; @@ -118,7 +126,7 @@ export default function DebateVotePage() {
+ + +
+ 정말로 종료하시겠습니까? +
+
+
); } From e32ed33524ad9fc638a6ce6f509e72429fb2bb30 Mon Sep 17 00:00:00 2001 From: jaeml06 Date: Tue, 2 Dec 2025 16:31:25 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=ED=88=AC=ED=91=9C=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=ED=99=94=EB=A9=B4=EC=97=90=EC=84=9C=20=EB=92=A4?= =?UTF-8?q?=EB=A1=9C=EA=B0=80=EA=B8=B0=20=EA=B8=88=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/DebateVotePage/DebateVotePage.tsx | 4 +--- .../DebateVoteResultPage.tsx | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/page/DebateVotePage/DebateVotePage.tsx b/src/page/DebateVotePage/DebateVotePage.tsx index 515dbe47..7641bf23 100644 --- a/src/page/DebateVotePage/DebateVotePage.tsx +++ b/src/page/DebateVotePage/DebateVotePage.tsx @@ -5,7 +5,6 @@ import DefaultLayout from '../../layout/defaultLayout/DefaultLayout'; import { useGetPollInfo } from '../../hooks/query/useGetPollInfo'; import ErrorIndicator from '../../components/ErrorIndicator/ErrorIndicator'; import useFetchEndPoll from '../../hooks/mutations/useFetchEndPoll'; -import GoToDebateEndButton from '../../components/GoToDebateEndButton/GoToDebateEndButton'; import { useModal } from '../../hooks/useModal'; import DialogModal from '../../components/DialogModal/DialogModal'; export default function DebateVotePage() { @@ -122,8 +121,7 @@ export default function DebateVotePage() { -
- +