-
Notifications
You must be signed in to change notification settings - Fork 0
[4주차 기본/심화/공유 과제] SOPT 회원 조회 페이지 #10
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
base: main
Are you sure you want to change the base?
Conversation
karnelll
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.
전체적으로 정말 깔끔하게 구현하신 것 같아요!!
페이지 흐름도 자연스럽고, 기능마다 UI/UX 흐름도 명확해서 보는 내내 이해가 쉬웠습니다. 스타일도 잘 정리돼 있어서 유지보수나 확장성 측면에서도 신경 쓴 게 느껴졌어요.
특히 회원가입을 step 단위로 나눈 구조나, 마이페이지에서 역할 분리한 구성은 되게 직관적이었고,
코드를 처음 보는 입장에서 동작 흐름이 눈에 잘 들어와서 좋았어요👍🔥 고생하셨습니다🙏
| setUserId(res.data.data.userId); | ||
| localStorage.setItem("userId", userId); |
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.
setUserId() 직후에 localStorage에 저장해서, 아직 이전 상태값이 들어갈 수도 있어요!! 응답 받은 userId를 변수에 따로 담아서 바로 저장해주면 더 확실할 것 같습니다!!
| <div css={btnStyle} onClick={handleLogin}> | ||
| 로그인 | ||
| </div> |
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.
로그인/회원가입 버튼이 div로 되어 있어서, disabled 같은 속성이 실제로는 적용되지 않는 것 같아 접근성이나 키보드 이동 같은 면에서도 button 태그로 바꾸면 더 좋을 것 같아요:)
<button css={btnStyle} onClick={handleLogin}>로그인</button>| <div | ||
| css={btnStyle} | ||
| onClick={handleNextStep} | ||
| style={{ opacity: isUsernameValid ? 1 : 0.5 }} | ||
| disabled={!isUsernameValid} | ||
| > |
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.
이 부분도 div는 disabled를 인식하지 않아서 실제로는 동작 안 하고 있을 수도 있을 것 같아요! <button disabled={!isUsernameValid}>로 바꾸면 로직은 그대로 유지하면서 UX도 좋아질 것 같습니다 :)
| {nicknameList.map((nickname, index) => ( | ||
| <li key={index}>{nickname}</li> | ||
| ))} |
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.
리스트 렌더링 시 key={index}를 쓰고 있는데, key={nickname}을 쓰면 React가 더 잘 추적해줄 수 있어 더 안정적이라고 합니다!! 😀
mnbvcxzyj
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.
4주차 과제 너무너무 고생하셨습니다 ㅎㅎㅎㅎ 이런 개발 천재를 보앗나 ㅋ
어떤 고민을 하시면서 코드를 작성하셨는지 그대로 보이는 좋은 코드인 거 같아서 많이 배워가요 !!!!
| } else if (name === "view") { | ||
| try { | ||
| const response = await api.get(`/api/v1/users?keyword=${inputValue}`); | ||
|
|
||
| const nicknameList = response.data.data.nicknameList || []; | ||
| if (nicknameList.length === 0) { | ||
| alert("닉네임이 없습니다."); | ||
| } else { | ||
| console.log("User details fetched successfully", response.data); | ||
| setNicknameList(nicknameList); | ||
| } | ||
| } catch (error) { | ||
| console.error("Error fetching user details", error); | ||
| alert("닉네임을 조회하는 데 실패했습니다."); | ||
| } |
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.
닉네임 변경이 아닌 부분은 따로 역할 분리를 하는 게 좋을 거 같아요 ! 혹시 하나로 작성하신 이유가 있을까요?
| <div css={btnStyle} onClick={handleUpdateNickname}> | ||
| {btnTxt} | ||
| </div> |
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.
클릭 가능한 요소는 button 태그를 사용하는게 시맨틱 측면에서 좋을듯 합니다 !!!
| headers: { userId }, | ||
| }); | ||
| // setUserName(res.data.data.nickname); | ||
| console.log(userName, "지금", res.data.data.nickname); |
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.
콘솔 훔쳐보기 ㅎ
soyyyyy
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.
api 연동할 때 response 데이터 타입 맞추는게 항상 헷갈렸는데 그 점을 적어주셔서 공감을 많이 했습니다 ㅎㅎ step을 나누어 회원가입 로직을 구현하시고 코드의 흐름 깔끔해서 보기에 편했던 것 같고 저도 emotion을 사용했어서 그런지 기존 로직 외에 스타일도 많이 배워갈 수 있었습니다!!!
4주차도 고생하셨습니다.재👍👍 재림쌤 사랑해요❤️
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.
과제라서 상관없긴 하지만 다른 프로젝트에선 보안 등을 위해 해당 파일은 .gitignore에 추가하면 좋을 것 같습니다 ㅎㅎ!!
| @@ -0,0 +1,13 @@ | |||
| <!doctype html> | |||
| <html lang="en"> | |||
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.
3주차 과제 때 배웠는데 사소하지만 ko로 바꾸면 좋을 것 같습니다!
| height: 100vh; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 50px; |
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.
rem이 웹 브라우저 마다 다른 기본 폰트 사이즈에 대응할 수 있다고 해서 border-radius처럼 딱 고정하는 크기 외에 rem을 사용해보시면 어떨지 제안드려봅니다!
| const res = await api.get("/api/v1/users/me", { | ||
| headers: { userId }, | ||
| }); | ||
| // setUserName(res.data.data.nickname); |
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.
저는 나아중의 저를 위해 콘솔을 남겨뒀었는데, 테스트용 콘솔은 지우는게 성능 등의 면에서 더 좋다고 합니닷
| }, [userId]); | ||
| const fetchDetailData = async () => { | ||
| try { | ||
| const res = await api.post("/api/v1/auth/signin", { |
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.
api 부분 axiosInstance 등을 통해 따로 분리해서 관리하면 더 편하고 깔끔해지더라구요!! 한 번 시도해보시는 걸 추천드리옵니다
🤙🏻 구현 기능 명세
💡 기본 과제
🔥 심화 과제
공유과제
제목:
링크 첨부 :
🚀 내가 새로 알게 된 점
🤔 구현 과정에서의 어려웠던/고민했던 부분
⏳ 소요 시간
10h🤳🏻 구현 결과물
KakaoTalk_20250513_231534330.mp4