-
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
Icon Component 생성 #18
Conversation
export default function Icon({ name, ...props }: Props) { | ||
switch (name) { | ||
case 'left-arrow': | ||
return <LeftArrowIcon {...props} />; |
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.
나중에 디자인 시스템 나오면 size도 타입관리하면 좋을듯!
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.
디자인 시스템이 나오면 수정할 수 있게 이슈에 추가해둘게여
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}> | ||
<path | ||
d="M13.7139 17.4273L6.43555 10.149L13.7139 2.87012" | ||
stroke={props.color ?? '#B0B8C1'} |
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.
컬러변경 굿...
마이너) svg 마다 defaultcolor 가 다르게 존재할까요?
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.
아이콘 사용하는 방법 배워갑니다..!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
# Conflicts: # src/components/Header.tsx # src/styled-system/tokens/tokens.d.ts # src/styled-system/types/prop-type.d.ts
🤔 해결하려는 문제가 무엇인가요?
Icon Component 생성
🎉 변경 사항
LeftArrowIcon
컴포넌트가 있지만, 이것이 아닌 ` 를 이용해 import 해오는 방식을 의도하였습니다.🙏 여기는 꼭 봐주세요!
LeftArrowIcon
과 같이{...props}
를 꼭 넣어주어야 합니다.사용 방법
/src/component/Icon
폴더에 해당 아이콘 svg Component를 만들어주세요 (/src/component/Icon/LeftArrowIcon.tsx
참고)/src/component/Icon/index.tsx
에서 IconType에 해당 아이콘을 식별할 name을 추가해주세요. (ex,left-arrow
)/src/component/Icon/index.tsx
의 switch return문 안에 밑과 같이 해당 아이콘을 추가해주세요.📚 참고