diff options
Diffstat (limited to 'components/auth/simple-reauth-modal.tsx')
| -rw-r--r-- | components/auth/simple-reauth-modal.tsx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/components/auth/simple-reauth-modal.tsx b/components/auth/simple-reauth-modal.tsx index f00674e3..80f03ad9 100644 --- a/components/auth/simple-reauth-modal.tsx +++ b/components/auth/simple-reauth-modal.tsx @@ -36,13 +36,15 @@ type ReAuthFormValues = z.infer<typeof reAuthSchema> interface SimpleReAuthModalProps { isOpen: boolean onSuccess: () => void + onClose?: () => void userEmail: string } -export function SimpleReAuthModal({ - isOpen, - onSuccess, - userEmail +export function SimpleReAuthModal({ + isOpen, + onSuccess, + onClose, + userEmail }: SimpleReAuthModalProps) { const [isLoading, setIsLoading] = React.useState(false) const [attemptCount, setAttemptCount] = React.useState(0) @@ -114,11 +116,18 @@ export function SimpleReAuthModal({ if (!isOpen) { form.reset() setAttemptCount(0) + if (onClose) { + // 모달이 닫힐 때 정리 작업 + } } - }, [isOpen, form]) + }, [isOpen, form, onClose]) return ( - <Dialog open={isOpen} onOpenChange={() => {}}> + <Dialog open={isOpen} onOpenChange={(open) => { + if (!open && onClose) { + onClose() + } + }}> <DialogContent className="sm:max-w-[400px]"> <DialogHeader> <DialogTitle className="flex items-center gap-2"> |
