From ab33840359f6388553588b3f317b7a484d98e4fa Mon Sep 17 00:00:00 2001 From: choihooo Date: Thu, 31 Oct 2024 05:04:40 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#40=20eslint=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[nonMemberId]/components/PincheckInput.tsx | 18 +++++++++--------- .../app/event-maps/[id]/[nonMemberId]/page.tsx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fe/src/app/event-maps/[id]/[nonMemberId]/components/PincheckInput.tsx b/fe/src/app/event-maps/[id]/[nonMemberId]/components/PincheckInput.tsx index d3683c6..27029d9 100644 --- a/fe/src/app/event-maps/[id]/[nonMemberId]/components/PincheckInput.tsx +++ b/fe/src/app/event-maps/[id]/[nonMemberId]/components/PincheckInput.tsx @@ -6,7 +6,7 @@ import { useRouter, useParams } from "next/navigation"; export default function PasswordInput() { const [password, setPassword] = useState(["", "", "", ""]); const [currentIndex, setCurrentIndex] = useState(0); - const [error, setError] = useState(false); + const [hasError, setHasError] = useState(false); // 변수명 변경 const inputRefs = useRef<(HTMLInputElement | null)[]>([]); const router = useRouter(); const { id, nonMemberId } = useParams(); @@ -35,13 +35,13 @@ export default function PasswordInput() { if (response.ok) { router.push(`/event-maps/${id}/${nonMemberId}/load-mappin-edit`); } else { - setError(true); + setHasError(true); // hasError로 변경 setPassword(["", "", "", ""]); setCurrentIndex(0); } } catch (error) { console.error("서버 오류:", error); - setError(true); + setHasError(true); // hasError로 변경 } }; @@ -75,7 +75,7 @@ export default function PasswordInput() { } setPassword(newPass); - setError(false); + setHasError(false); // hasError로 변경 } }; @@ -88,7 +88,7 @@ export default function PasswordInput() {
- {error && ( + {hasError && (

비밀번호가 일치하지 않아요

diff --git a/fe/src/app/event-maps/[id]/[nonMemberId]/page.tsx b/fe/src/app/event-maps/[id]/[nonMemberId]/page.tsx index 6d309a3..f6ac537 100644 --- a/fe/src/app/event-maps/[id]/[nonMemberId]/page.tsx +++ b/fe/src/app/event-maps/[id]/[nonMemberId]/page.tsx @@ -1,8 +1,8 @@ "use client"; import Image from "next/image"; -import PasswordInput from "./components/PincheckInput"; import NavBar from "@/app/components/common/Navigation"; +import PasswordInput from "./components/PincheckInput"; export default function PasswordPage() { return (