-
Notifications
You must be signed in to change notification settings - Fork 6
Typography Component 개발 #30
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
Conversation
leeminhee119
left a comment
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.
너무 좋습니다 🍀
|
|
||
| type TypographyProps = { | ||
| as?: React.ElementType; | ||
| variant?: keyof typeof DESIGN_SYSTEM_TEXT; | ||
| color?: keyof typeof DESIGN_SYSTEM_COLOR; | ||
| children: string; | ||
| }; |
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.
| type TypographyProps = { | |
| as?: React.ElementType; | |
| variant?: keyof typeof DESIGN_SYSTEM_TEXT; | |
| color?: keyof typeof DESIGN_SYSTEM_COLOR; | |
| children: string; | |
| }; | |
| type TextTags = "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; | |
| type TypographyProps = { | |
| as?: Extract<React.ElementType,TextTags>; | |
| variant?: keyof typeof DESIGN_SYSTEM_TEXT; | |
| color?: keyof typeof DESIGN_SYSTEM_COLOR; | |
| children: string; | |
| }; |
현재는 모든 태그를 넣을 수 있도록 되어 있는데, 다음과 같이 TextTag로 타입을 한정 시키는 것도 괜찮아 보입니다~!!
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.
Extract라는 교집합 문법이 있군요!! 하나 또 알아갑니다~!!
| <Component | ||
| css={css` | ||
| ${DESIGN_SYSTEM_TEXT[variant]} | ||
| color: ${DESIGN_SYSTEM_COLOR[color]}; | ||
| `} | ||
| > | ||
| {children} | ||
| </Component> |
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.
ㅇ.. 이거야.. 우리가 썼던 장점들의 집합체.. ✨
donghunee
left a comment
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.
수고 많으셨습니다:)
| <Component | ||
| css={css` | ||
| ${DESIGN_SYSTEM_TEXT[variant]} | ||
| color: ${DESIGN_SYSTEM_COLOR[color]}; | ||
| `} | ||
| > | ||
| {children} | ||
| </Component> |
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.
ㅇ.. 이거야.. 우리가 썼던 장점들의 집합체.. ✨
🏄🏼♂️ Summary (요약)
🫨 Describe your Change (변경사항)
🧐 Issue number and link (참고)
📚 Reference (참조)
다이나믹 태그와 디자인 토큰을 props로 받아 간단하게 Text를 사용할 수 있도록 개발했습니다.
=> 디자인 토큰 관련 파일에 경우 확정이 아니라 아직 디자인 나올때까지 임시 삽입본입니다.