-
Notifications
You must be signed in to change notification settings - Fork 1
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
[#90] 로그인 & 쿠폰 수정 공용 모달 컴포넌트 구현 및 로그인 페이지 적용 #94
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
수고하셨습니다!👍🏻
try { | ||
const response = await instance.post('/v1/member/login', loginData); | ||
return response; | ||
} catch (error) { | ||
if (error instanceof AxiosError) { | ||
return error.response; | ||
} | ||
} | ||
}; |
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.
이 부분은 나중에 쿼리로 바꾸실 예정인가요?!
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.
로그인에서는 로딩 처리를 별도로 하지 않고, 에러 처리도 모달을 띄우도록 되어있어서 쿼리 사용은 하지 않으려고 합니다..!
제가 mutation에 대해 잘 몰라서 그런걸 수도 있어서 혹시 더 좋은 방법이 있다면 제안주시면 너무 좋을 것같습니다!
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.
로그인과 회원가입 부분은 서버 상태에 따라서 클라이언트 상태가 변하는 부분이 크게 없어서 (현재 프로젝트에서는 클라이언트와 서버 각각 상태를 관리하는 상횡) 리액트 쿼리를 사용하지 않으셔도 충분할 것 같습니다!
다만 비동기 처리에 대해서 react-error-boundary가 감지하지 못해서 토스트로 에러 메시지를 사용자에거 띄워주는 작업이 필요할 수 있습니다!
Suspense 동작은 GET 요청을 사용하고 계시지 않기 때문에 로그인 전체 레이아웃을 가져오는 부분에서 감사주고 사용하시면 될 것 같습니다!
return ( | ||
<Backdrop> | ||
<Modal> | ||
<Icon | ||
src={ErrorIcon} | ||
alt="에러 아이콘" | ||
/> | ||
<Text>{modalContent.text}</Text> | ||
<ErrorText>{modalContent.errorText}</ErrorText> | ||
<ConfirmButton onClick={ButtonFunc}>확인</ConfirmButton> |
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.
에러 모달 처리도 깔끔하게 해주신 것 같아요! 👍🏻
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.
비동기 처리의 catch 문에서 throw error 를 통해 에러가 콘솔에 잡히는지 에러 바운더리에서 잡히는지 확인해보시고 말씀해주시면 감사드리겠습니다!
고생하셨습니다!
close #90
Description
로그인 페이지와 쿠폰 수정에서 공통으로 사용할 모달 컴포넌트를 생성했습니다.
로그인 페이지에서 오류가 발생했을 경우 해당 모달 띄우는 작업까지 완료했습니다.
스크린샷 (Optional)
2024-01-24.2.01.38.mov