-
Notifications
You must be signed in to change notification settings - Fork 40
[신휘철] Sprint11 #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[신휘철] Sprint11 #332
The head ref may contain hidden characters: "Next-\uC2E0\uD718\uCCA0-sprint11"
Conversation
jyh0521
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다.
| {login && signup && <Header />} | ||
| <Component {...pageProps} /> | ||
| <Footer /> | ||
| {login && signup && <Footer />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저번에 말씀드렸던 getLayout 기능을 활용해서 페이지 별로 Layout을 지정해보시는 것도 좋을 것 같습니다.
| password: "", | ||
| }); | ||
| const [isPasswordHidden, setIsPasswordHidden] = useState(false); | ||
| const [emailErrorMessage, setEmailErrorMessage] = useState(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러가 없는 경우에 빈 문자열 보다는 null 같은 값으로 명시적으로 표시해주시는 것도 좋을 것 같습니다.
| setLoginInfo((prevLoginInfo) => ({ | ||
| ...prevLoginInfo, | ||
| [name]: value, | ||
| })); | ||
|
|
||
| if (name === "password") { | ||
| if (loginInfo.password.length < 7) { | ||
| setPasswordErrorMessage("비밀번호를 8자 이상 입력해 주세요."); | ||
| } else { | ||
| setPasswordErrorMessage(""); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password 상태가 반영된 후에 에러가 뜰 것 같아서 에러를 먼저 처리해주시고 상태가 반영되게 하는건 어떨까요?
| <div className="inner"> | ||
| <h1> | ||
| <Link className="logo" href={"/"}> | ||
| <Image src={Logo} alt="logo" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next/image는 width / height나 fill이 없으면 잘 동작하지 않을텐데 괜찮나요?
| const handlePasswordToggleClick = () => { | ||
| setIsPasswordHidden(!isPasswordHidden); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
토글하는 로직이 많은 것 같은데 훅으로 만들어보셔도 좋을 것 같습니다.
| const router = useRouter(); | ||
| const [login, setLogin] = useState(false); | ||
| useEffect(() => { | ||
| if (localStorage.getItem("accessToken")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localStorage에서 accessToken을 가져와서 로그인 시켜버린다면, 악성 유저가 accessToken을 강제로 넣었을때도 로그인 됐다고 뜰 것 같습니다. 다른 방법도 생각해보시면 좋을 것 같아요.
요구사항
체크리스트[기본]
회원가입 페이지
로그인 페이지
메인
스크린샷
스크린샷 대신 URL로 대체하겠습니다.
배포 URL: https://hwiiron.netlify.app/
멘토님에게