-
Notifications
You must be signed in to change notification settings - Fork 37
[박형준] Sprint 4 #174
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
[박형준] Sprint 4 #174
The head ref may contain hidden characters: "Basic-\uBC15\uD615\uC900-sprint4"
Conversation
kich555
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.
잘 해주셨어요! 고생하셨습니다!
| let [isEmailValid, isNicknameValid, isPwValid, isPwcheckValid] = [ | ||
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| ]; |
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 validationState = {
email: false,
nickname: false,
password: false,
passwordConfirm: false,
};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.
다음 스프린트에 수정 반영하겠습니다!! :)
| alertList[0].style.display = 'block'; | ||
| alertList[1].style.display = 'none'; | ||
| e.target.style.border = '1px solid #F74747'; | ||
| isEmailValid = false; |
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.
이렇게 생긴 로직이 여기저기 많이 보이는데
function showAlert(inputElement, alertMessages, visibleIndex) {
alertMessages.forEach((alert, index) => {
alert.style.display = index === visibleIndex ? 'block' : 'none';
});
inputElement.style.border = '1px solid #F74747';
}
function hideAlert(inputElement, alertMessages) {
alertMessages.forEach(alert => {
alert.style.display = 'none';
});
inputElement.style.border = 'none';
}이렇게 별도의 함수를 구성하고 활용하는게 어떤가요? ㅎ
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.
저도 똑같은 코드가 너무 반복되다보니 이 부분이 찜찜했었는데, 앞으론 함수를 활용해서 로직을 구조화시킬 방법을 더 고민해보겠습니다. 리뷰 내용은 다음 스프린트에 수정반영하겠습니다.
요구사항
기본
로그인
회원가입
심화
주요 변경사항
스크린샷
로그인
<입력 없이 focusout 되었을 때>

<유효성에 맞지 않을 때>

<모두 만족하고 로그인 버튼 활성화>

회원가입
<입력 없이 focusout 되었을 때>

<유효성에 맞지 않을 때>

<모두 만족하고 회원가입 버튼 활성화>

멘토에게