-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
src/components/Toast/Toast.style.ts
Outdated
@keyframes hide { | ||
0% { | ||
opacity: 1; | ||
} | ||
80% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
} |
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.
p2;
opacity로 UI를 가리면 뒤에있는 뒤에있는 요소들이 클릭되지 않는 이슈가 있어서...
100%일때 height을 0으로 만들어 버린다던지 하는 처리가 필요할 것 같아요!
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.
헉 그런 이슈가 있군요 배워갑니다! 100% 일때 display: none 으로 설정해두겠습니다!
src/components/Toast/Toast.tsx
Outdated
interface ToastProps { | ||
width: number; | ||
height: number; | ||
content: string; | ||
type: 'WARNING' | 'ERROR' | 'ALERT' | 'SUCCESS'; | ||
} |
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.
p2;
스타일드 컴포넌트에서는 width,height이 optional속성인데 여기서는 필수네요!
여기서도 optional속성으로 만들고 인자를 받아올때 기본값을 주면 좋을것같아요!
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.
LGTM 👍
제안: hide 2초는 체감상 좀 빠르게 느껴져서... 한 3초로 늘리고 Toast 클릭 시 바로 display:none
처리 시키는 로직을 포함시키는건 어떨까요? (보통 우측에 닫기 버튼으로 구현돼있는 느낌)
src/components/Toast/Toast.tsx
Outdated
type: 'WARNING' | 'ERROR' | 'ALERT' | 'SUCCESS'; | ||
} | ||
|
||
const Toast = ({ width, height, content, type }: Partial<ToastProps>) => { |
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.
Partial 타입으로 지정하신 이유가 있을까요?
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.
생각해보니...content type 은 필수로 두고 width 와 height 만 선택속성으로 둬야겠네요!
- 2초에서 3초로 애니메이션 시간을 증가시켰습니다.
🪄 변경사항
toast UI 구현
🖥 결과 화면
✏️ PR 포인트
생략합니다.