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

[style] 다이얼로그 컴포넌트 제작 #136

Merged
merged 6 commits into from
Feb 8, 2024
Merged

Conversation

Ssoon-m
Copy link
Collaborator

@Ssoon-m Ssoon-m commented Feb 7, 2024

구현한 것

  • 컴파운드 컴포넌트 패턴으로 구현
  • 애니메이션이 있을 경우 애니메이션에 의존해서 모달을 dom에 렌더링
  • error color 정의
  • Button 컴포넌트 color props 추가 (error,secondary)

구현하지 않은 것

  • 모달 접근성 (추후 구현할 예정입니당)
    • 모달 포커스 트랩, a11y

동작 확인

2024-02-07.3.24.57.mov

@Ssoon-m Ssoon-m requested a review from tolluset February 7, 2024 06:26
@Ssoon-m Ssoon-m linked an issue Feb 7, 2024 that may be closed by this pull request
@Ssoon-m Ssoon-m added the style css 요소 수정 사항 label Feb 7, 2024
@Ssoon-m Ssoon-m self-assigned this Feb 7, 2024
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

radix-ui 매우 많이 참고해서 구현을 했습니당

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

해당 컴포넌트는 애니메이션동작이 완료될 때까지 마운트 해제를 지연해줍니다

Comment on lines +206 to +211
function handler(childHanlder?: (e: React.MouseEvent<HTMLButtonElement>) => void) {
return (e: React.MouseEvent<HTMLButtonElement>) => {
childHanlder?.(e);
others.onClick?.(e);
};
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

asChild가 있으면 자식 컴포넌트로 렌더링을 대체합니다.

asChild props가 존재할 경우 해당 컴포넌트에 부착한 click handler와 자식 컴포넌트의 click handler모두 실행시키기 위한 메서드 입니다.

Copy link
Collaborator

@tolluset tolluset left a comment

Choose a reason for hiding this comment

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

presence 하는 방법 framer-motion으로 밖에 안써봤는데 요렇게도 할 수 있네여 ㄷ.ㄷ 👍👍👍👍👍👍👍

@@ -13,7 +13,19 @@ module.exports = {
colors: {
white: '#FFFFFF',
black: '#000000',
error: '#EB001C',
// error: '#EB001C',
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

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.

앗 감사합니다 까먹고 못 지웠네요 ㅠㅠ

Comment on lines 86 to 90
* prevAnimationName과 currentAnimationName이 다르다는 것은 애니메이션이 정상적으로 실행중이라는 뜻이다.
*
* state가 mounted상태가 됐을 때
* prevAnimationName에 애니메이션이 실행 될 때의 이름을 저장한 상태
* currentAnimationName엔 닫기 버튼을 누를 경우 실행되는 애니메이션 이름이 저장이 된 상태
Copy link
Collaborator

Choose a reason for hiding this comment

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

이런 방식이군여 👀 신기하네여

@Ssoon-m Ssoon-m merged commit 9c75337 into main Feb 8, 2024
@Ssoon-m Ssoon-m deleted the style/130/dialog branch February 8, 2024 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style css 요소 수정 사항
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] 다이얼로그 모달 컴포넌트 만들기
2 participants