Skip to content
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

Merged
merged 6 commits into from
Jan 24, 2024

Conversation

dabin-Hailey
Copy link
Collaborator

@dabin-Hailey dabin-Hailey commented Jan 23, 2024

close #90

Description

로그인 페이지와 쿠폰 수정에서 공통으로 사용할 모달 컴포넌트를 생성했습니다.
로그인 페이지에서 오류가 발생했을 경우 해당 모달 띄우는 작업까지 완료했습니다.

  • 입력한 이메일(회원) 정보가 없을 때
  • 비밀번호가 올바르지 않을 때

스크린샷 (Optional)

스크린샷 2024-01-24 오전 1 59 42 스크린샷 2024-01-24 오전 1 59 52
2024-01-24.2.01.38.mov

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cool-peace ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 5:11am
cool-peace-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 5:11am

Copy link
Collaborator

@jinjoo-jung jinjoo-jung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!👍🏻

Comment on lines +7 to 15
try {
const response = await instance.post('/v1/member/login', loginData);
return response;
} catch (error) {
if (error instanceof AxiosError) {
return error.response;
}
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 나중에 쿼리로 바꾸실 예정인가요?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인에서는 로딩 처리를 별도로 하지 않고, 에러 처리도 모달을 띄우도록 되어있어서 쿼리 사용은 하지 않으려고 합니다..!
제가 mutation에 대해 잘 몰라서 그런걸 수도 있어서 혹시 더 좋은 방법이 있다면 제안주시면 너무 좋을 것같습니다!

Copy link
Collaborator

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 요청을 사용하고 계시지 않기 때문에 로그인 전체 레이아웃을 가져오는 부분에서 감사주고 사용하시면 될 것 같습니다!

Comment on lines +7 to +16
return (
<Backdrop>
<Modal>
<Icon
src={ErrorIcon}
alt="에러 아이콘"
/>
<Text>{modalContent.text}</Text>
<ErrorText>{modalContent.errorText}</ErrorText>
<ConfirmButton onClick={ButtonFunc}>확인</ConfirmButton>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

에러 모달 처리도 깔끔하게 해주신 것 같아요! 👍🏻

Copy link
Collaborator

@JitHoon JitHoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비동기 처리의 catch 문에서 throw error 를 통해 에러가 콘솔에 잡히는지 에러 바운더리에서 잡히는지 확인해보시고 말씀해주시면 감사드리겠습니다!

고생하셨습니다!

@dabin-Hailey dabin-Hailey merged commit ace2945 into dev Jan 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 로그인 & 쿠폰 수정 공용 모달 컴포넌트 구현 및 로그인 페이지 적용
3 participants