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: Toast UI 구현 #68

Merged
merged 15 commits into from
Sep 22, 2023
Merged

✨ Feat: Toast UI 구현 #68

merged 15 commits into from
Sep 22, 2023

Conversation

suyeon1218
Copy link
Collaborator

🪄 변경사항

toast UI 구현

  • type 에 따라 각각 다른 toast UI 를 보여줍니다.
  • type 은 각각 4 종류가 있습니다. (쓸진 모르겠음...)
  • react-query 에서 isError 가 true 일 시 해당 UI 를 보여주는 식으로 호출합니다.
isError && <Toast content='에러났다 큰일큰일'>

🖥 결과 화면

toast_ui

✏️ PR 포인트

생략합니다.

@suyeon1218 suyeon1218 self-assigned this Sep 21, 2023
Comment on lines 43 to 53
@keyframes hide {
0% {
opacity: 1;
}
80% {
opacity: 1;
}
100% {
opacity: 0;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2;
opacity로 UI를 가리면 뒤에있는 뒤에있는 요소들이 클릭되지 않는 이슈가 있어서...
100%일때 height을 0으로 만들어 버린다던지 하는 처리가 필요할 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

헉 그런 이슈가 있군요 배워갑니다! 100% 일때 display: none 으로 설정해두겠습니다!

Comment on lines 3 to 8
interface ToastProps {
width: number;
height: number;
content: string;
type: 'WARNING' | 'ERROR' | 'ALERT' | 'SUCCESS';
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2;
스타일드 컴포넌트에서는 width,height이 optional속성인데 여기서는 필수네요!
여기서도 optional속성으로 만들고 인자를 받아올때 기본값을 주면 좋을것같아요!

Copy link
Member

@sscoderati sscoderati left a comment

Choose a reason for hiding this comment

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

LGTM 👍
제안: hide 2초는 체감상 좀 빠르게 느껴져서... 한 3초로 늘리고 Toast 클릭 시 바로 display:none 처리 시키는 로직을 포함시키는건 어떨까요? (보통 우측에 닫기 버튼으로 구현돼있는 느낌)

type: 'WARNING' | 'ERROR' | 'ALERT' | 'SUCCESS';
}

const Toast = ({ width, height, content, type }: Partial<ToastProps>) => {
Copy link
Member

Choose a reason for hiding this comment

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

Partial 타입으로 지정하신 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

생각해보니...content type 은 필수로 두고 width 와 height 만 선택속성으로 둬야겠네요!

@suyeon1218 suyeon1218 merged commit 79bd665 into main Sep 22, 2023
@suyeon1218 suyeon1218 deleted the feat/common/toast branch September 22, 2023 08:23
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.

3 participants