dm: login 입력란 초기화
This commit is contained in:
@@ -63,10 +63,15 @@ export default function LoginModal({
|
||||
setSubmitting(false);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
resetForm();
|
||||
onClose();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") onClose(); // ESC 키로 모달 닫기
|
||||
if (e.key === "Escape") handleClose(); // ESC 키로 모달 닫기
|
||||
};
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
|
||||
@@ -77,9 +82,8 @@ export default function LoginModal({
|
||||
return () => {
|
||||
window.removeEventListener("keydown", onKeyDown);
|
||||
document.body.style.overflow = prev;
|
||||
resetForm();
|
||||
};
|
||||
}, [open, onClose]);
|
||||
}, [open]);
|
||||
|
||||
useEffect(() => {
|
||||
if (noWorker) {
|
||||
@@ -160,7 +164,7 @@ export default function LoginModal({
|
||||
if (sessionUser) {
|
||||
const parsed = JSON.parse(sessionUser) as { dmdCoNm?: string };
|
||||
onSuccess?.({ userName: parsed.dmdCoNm ?? "수요처" });
|
||||
onClose();
|
||||
handleClose();
|
||||
router.push("/apply/status");
|
||||
}
|
||||
} finally {
|
||||
@@ -180,7 +184,7 @@ export default function LoginModal({
|
||||
<button
|
||||
type="button"
|
||||
aria-label="닫기"
|
||||
onClick={onClose}
|
||||
onClick={handleClose}
|
||||
className="absolute inset-0 bg-black/40"
|
||||
/>
|
||||
|
||||
@@ -196,7 +200,7 @@ export default function LoginModal({
|
||||
<div className="relative px-10 pt-10">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
onClick={handleClose}
|
||||
aria-label="닫기"
|
||||
className="absolute right-8 top-8 z-40 h-10 w-10 grid place-items-center rounded-full hover:bg-gray-100"
|
||||
>
|
||||
@@ -352,7 +356,10 @@ export default function LoginModal({
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {onClose(); router.push(REGISTER_HREF);}}
|
||||
onClick={() => {
|
||||
handleClose();
|
||||
router.push(REGISTER_HREF);
|
||||
}}
|
||||
className="shrink-0 rounded-[4px] h-[48px] px-10 bg-[#004A94] text-white text-[18px] hover:opacity-95"
|
||||
>
|
||||
수요처등록
|
||||
|
||||
Reference in New Issue
Block a user