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

[Refactor] Box 컴포넌트의 children의 가로 길이가 100%가 되도록 해요. #101

Merged
merged 3 commits into from
Jul 27, 2024

Conversation

eugene028
Copy link
Collaborator

🎉 변경 사항

Box 컴포넌트의 내부 children이 span태그로 이루어져 있고, 이를 감싸고 있는 Flex 컴포넌트들의 가로 길이가 fit-content 형식이라 내부에서 아무리 width를 100을 주어도 내부 요소의 가로 길이가 늘어나지 않는 문제가 있었어요.

이를 해결하기 위하여 Box의 내부 element를 감싸고 있는 요소들의 가로 길이를 100%로 설정하였어요.

🚩 관련 이슈

#100

🙏 여기는 꼭 봐주세요!

@hamo-o
props 중에서 textchildren을 분리하기가 어려운 이유가..
아래 사진과 같이 포멀한 Box의 상태로 사용하고 싶을 때에도 글자를 굵게 하거나 언더라인을 치고 싶을 때를 대비하여서 text를 아예 ReactNode를 받도록 해 두었어요. (텍스트 꾸미기를 다양하게 하기 위해)
스크린샷 2024-07-25 오후 6 39 28

그리고 위의 사진과 같이 사용하는 예시를 일반적인 형태로 보고 개발하여서, ReactNode만으로만 Box 요소를 채워넣는다던가 하는 것은 일반적이지 않은 경우 같아서 현 상태의 props구조를 유지하는게 좋을 것 같기도 해용!

Copy link
Contributor

Copy link
Collaborator

@ghdtjgus76 ghdtjgus76 left a comment

Choose a reason for hiding this comment

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

굿굿

@ghdtjgus76 ghdtjgus76 linked an issue Jul 26, 2024 that may be closed by this pull request
2 tasks
Copy link
Collaborator

@SeieunYoo SeieunYoo left a comment

Choose a reason for hiding this comment

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

wow-ui changest 도 작성해주시면 좋을 것 같아요~!

@@ -86,21 +86,23 @@ const Box = <T extends BoxVariantType = "text">({
onClick={handleArrowClick}
{...rest}
>
<Flex alignItems="center" direction="row" gap="xs">
<Flex alignItems="center" direction="row" gap="xs" width="100%">
Copy link
Collaborator

Choose a reason for hiding this comment

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

image
p4;
스토리북 살펴보다가 발견,,,오른쪽 요소가 없을 때에는 gap 이 들어가지 않으면 좋을 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

역시 꼼꼼세은 🥰 감사합니당

Copy link
Member

@hamo-o hamo-o left a comment

Choose a reason for hiding this comment

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

감사합니둥!!
아래처럼 jsdoc이 스토리북에 나오는 문제가 있는데 해당 jsdocBoxProps 인터페이스 위쪽으로 올리면 좋을 것 같아요!

image

@eugene028
Copy link
Collaborator Author

감사합니둥!! 아래처럼 jsdoc이 스토리북에 나오는 문제가 있는데 해당 jsdocBoxProps 인터페이스 위쪽으로 올리면 좋을 것 같아요!

image

오 그렇군요! 체크해주셔서 감사합니다~

Copy link
Contributor

@eugene028 eugene028 merged commit 15f3271 into main Jul 27, 2024
3 checks passed
@eugene028 eugene028 deleted the refactor/box-width branch July 27, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] Box 컴포넌트 스펙 수정 (text, children)
4 participants