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

feat-fe: Toast구현 #570

Merged
merged 9 commits into from
Aug 21, 2024
Merged

feat-fe: Toast구현 #570

merged 9 commits into from
Aug 21, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 21, 2024

Original issue description

목적

Toast구현

작업 세부사항

  • Toast 컴포넌트 구현
  • Toast Context 구현

참고 사항

아래의 별표줄 밑에 요구사항 ID만 작성해주세요. Prefix 금지!


TOAST

closes #569

  • Toast Provider 구현했습니다. id값 이슈 있었는데 ref로 변경해서 해결
  • mutate 모든 에러에 대해서 Toast 처리 했습니다.

@github-actions github-actions bot added frontend 프론트엔드 refactor 기존 코드 수정 labels Aug 21, 2024
@lurgi lurgi marked this pull request as ready for review August 21, 2024 07:25
Copy link
Contributor Author

1724225170.163889

@lurgi lurgi requested review from llqqssttyy and seongjinme August 21, 2024 07:26
Copy link
Contributor Author

1724225179.002239

Copy link
Contributor

@seongjinme seongjinme 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 +80 to +81
message:
'Primary Alert Primary Alert Primary Alert Primary Alert! Primary Alert Primary Alert Primary Alert Primary Alert Primary Alert Primary Alert Primary Alert Primary !!! Alert Primary Alert Primary Alert Primary Alert Primary Alert Primary',
Copy link
Contributor

Choose a reason for hiding this comment

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

🤣 🤣 🤣

Comment on lines +23 to +32
const handleAlert = useCallback(
(type: ToastType) => (message: string) => {
const id = idRef.current;
setToastList((prev) => [...prev, { id, type, message }]);
idRef.current += 1;

setTimeout(() => removeToast(id), 4000);
},
[],
);
Copy link
Contributor

Choose a reason for hiding this comment

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

setTimeout과 연계해서 toast id값을 다룰 때 state 대신 ref로 구현하신 부분에 대해서 추후 자세한 설명을 요청드리고 싶어요. 어떠한 원리로 인하여 state는 문제가 생기고 ref는 통과되는지 좀 더 살펴보고 싶습니다. 🙏

@lurgi lurgi merged commit 467d5b0 into fe/develop Aug 21, 2024
21 checks passed
@lurgi lurgi deleted the fe-569-TOAST branch August 21, 2024 08:48
seongjinme pushed a commit that referenced this pull request Aug 23, 2024
Co-authored-by: Jeongwoo Park <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend 프론트엔드 refactor 기존 코드 수정
Projects
Status: 완료
Development

Successfully merging this pull request may close these issues.

3 participants