[style] 버튼 공통 컴포넌트 #32 #34
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 기능 설명
Button컴포넌트와 TextButton컴포넌트 제작
Button컴포넌트의 Props
size?: 'default' | 'sm'; : 버튼의 사이즈 설정 기본값 : default = default 사이즈
color?: 'default' | 'purple' ; : 버튼의 색 설정 기본값 : default = 버터색
ref?: Ref<HTMLButtonElement | null>;: ref 옵셔널 설정
disabled?: boolean; : disable 설정
type: 'submit' | 'button'; : 버튼 타입 설정 기본값 = button
children?: React.ReactNode; : 버튼안에 들어갈 텍스트 혹은 아이콘
className?: string; : 추가 className
...rest : 추가사항 ex) aria-label
disabled 설정시 조건부 스타일링으로 인하여 스타일링이 변경되게끔 바꿨습니다.
TextButton컴포넌트의 Props
size?: 'default' | 'sm'; : 버튼의 사이즈 기본값 = default
type?: 'button' | 'submit'; 버튼 type설정 기본값 = button
ref?: Ref<HTMLButtonElement | null>; : ref설정
children: React.ReactNode; : 버튼 안 텍스트 혹은 아이콘
className?: string; :추가 className
텍스트 버튼의 컬러는 고정인 것 같아서 언더바는 흰색으로 고정하고
텍스트 컬러는 디자인시스템 작업 후 base에서 변경하는게 좋을 것 같아서 검정색으로 되어있습니다.
네이비 컬러가 없길래 theme.css에 추가하였습니다.
--color-navy:#1f2544;
inner-shadow는 theme.css에 추가해두었습니다.
--inset-shadow-black: inset 0 2px 6px rgba(0, 0, 0, 0.3);검정색 이너 쉐도우
--inset-shadow-white: inset 0 0 8px rgba(255, 255, 255, 0.8);흰색 이너쉐도우
🩷 Approve 하기 전 확인해주세요!
✅ 체크리스트