Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#️⃣ Related Issue
Closes #271
✅ Done Task
💎 PR Point
기존에는 다음단계로 넘어갔다가 다시 돌아오면 입력했던 닉네임 문자는 유지되지만, 중복체크했던 여부는 유지되지 않아서 매번 다시 중복체크를 했어야 했어요.
중복체크 여부가 유지될 수 있도록 context data에
isNicknameValid
필드를 추가해줬습니다!Step개인정보입력 컴포넌트 내에서 nicknameStatus state는 INVALID, CONFLICT, VALID, EMPTY 이런 값을 쓰고 있는데, 왜 context에서는 boolean 값으로 관리해주냐! 하실 수 있는데,
해당 단계 내에서 어차피 중복체크status가
VALID
된 경우에만 다음단계로 넘아갈 수 있기 때문에,다음단계 버튼을 클릭할 경우에 저장되는 context data에서 닉네임은 항상 유효하다고 보장할 수 있어요. 그래서
true
값으로 바로 넘겨줍니다.그리고 다시 단계 돌아왔을 때, 만약 isNicknameValid에
true
값이 저장되어있다면 최초로 단계에 진입한게 아니라 이미 중복체크하고 다음단계 넘어왔다가 돌아왔다는 뜻이니까 status 초기값을VALID
로, 그게 아니라면EMPTY
상태로 초기화해주도록 구현했어요 !📸 Screenshot
2024-10-14.7.02.35.mov