-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/2/커스텀 라디오 버튼 #21
Conversation
children?: React.ReactNode; | ||
}; | ||
|
||
const ListItemCard = ({ variant, height = "5rem", borderRadius = ".8rem", children }: ListItemCardProps) => { |
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.
children을 옵셔널하게 사용하는거면 PropsWithChildren을 사용해도 좋을 것 같다는 생각도 들어요 🤔
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.
오호 PropsWithChildren이라는 게 있군요! 하나 알아갑니다 감사해요 👍
여기 children은 항상 들어가게 될 텐데 잘못 적은 것 같네요 !! 수정할게용
src/style/global.css
Outdated
html { | ||
font-size: 62.5%; | ||
font-size: 62.5%; | ||
} | ||
|
||
body { | ||
font-size: 1.5rem; | ||
margin: 0; | ||
padding: 0; | ||
} No newline at end of file | ||
font-size: 1.5rem; | ||
margin: 0; | ||
padding: 0; | ||
} |
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 RadioButtonGroupProps = { | ||
children: React.ReactNode; | ||
selectedValue: string | undefined; |
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.
selectedValue를 Optional로 설정하지 않은 이유가 있을까요?
string | undefined면 Optional하게 설정하는 것도 좋아보입니다~!!
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.
넵넵! 아무것도 선택하지 않은 경우는 값이 undefined인데, undefined 이더라도 반드시 props로 전달해야 Radio 컴포넌트 안에서 값을 읽을 수 있어서 이렇게 작성했습니다 !! optional로 설정하면 개발자 실수로 props를 전달하지 않게 될 수 있을 것 같아서요!
Co-authored-by: klm hyeon woo <gentlemonster77@likelion.org>
c846cbc
to
148b0ae
Compare
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.
고생하셨습니다 🍕
LGTM ✨ |
🏄🏼♂️ Summary (요약)
🫨 Describe your Change (변경사항)
ListItemCard
: 라디오버튼 형태가 라디오버튼 뿐만 아니라 아래와 같은 경우들에도 쓰일 것 같아 공통 컴포넌트로 빼두었습니다. 이 경우에도 카드라고 칭하는게 적합한지 모르겠는데 더 좋은 이름 있으면 추천해주세요..!라디오 버튼
: 아래와 같이 작성하면 영상과 같이 작동합니다.2024-07-06.11.32.44.mov
🧐 Issue number and link (참고)
공통 컴포넌트 정의 #11
커밋메시지에 이슈 번호를 #2로 잘못 적었네요.. 몇개 깜빡하고 누락도 됐어요 죄송합니다아
원래는 라디오 버튼에 국한되지 않고 props로 다중 선택이 가능하도록 지정하면 다중 선택도 가능하도록 개발하고 싶었는데, PR이 늦어질 것 같아 우선 라디오버튼이라도 올립니다!
변수/함수명, 로직, 구조 등등 피드백 많이 많이 해주세요!! 🙇♀️
📚 Reference (참조)