-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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.
굿굿
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.
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%"> |
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.
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.
역시 꼼꼼세은 🥰 감사합니당
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.
🎉 변경 사항
Box 컴포넌트의 내부 children이 span태그로 이루어져 있고, 이를 감싸고 있는 Flex 컴포넌트들의 가로 길이가
fit-content
형식이라 내부에서 아무리 width를 100을 주어도 내부 요소의 가로 길이가 늘어나지 않는 문제가 있었어요.이를 해결하기 위하여 Box의 내부 element를 감싸고 있는 요소들의 가로 길이를 100%로 설정하였어요.
🚩 관련 이슈
#100
🙏 여기는 꼭 봐주세요!
@hamo-o

props 중에서
text
와children
을 분리하기가 어려운 이유가..아래 사진과 같이 포멀한 Box의 상태로 사용하고 싶을 때에도 글자를 굵게 하거나 언더라인을 치고 싶을 때를 대비하여서 text를 아예 ReactNode를 받도록 해 두었어요. (텍스트 꾸미기를 다양하게 하기 위해)
그리고 위의 사진과 같이 사용하는 예시를 일반적인 형태로 보고 개발하여서, ReactNode만으로만 Box 요소를 채워넣는다던가 하는 것은 일반적이지 않은 경우 같아서 현 상태의 props구조를 유지하는게 좋을 것 같기도 해용!