-
Notifications
You must be signed in to change notification settings - Fork 10
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
[조은서] 리액트 과제 끝! #7
base: 조은서
Are you sure you want to change the base?
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.
안녕하세요 은서님! 리액트를 처음 접해보아 어색하셨을 텐데, 과제 잘 수행해주셨네요!
특히 버튼에 그라데이션을 예쁘게 적용해주셔서 인상깊었던 것 같아요.
몇가지 수정하면 좋을 것들을 코멘트로 남겨드릴게요. 참고만 해주세요 😁
<MediaCard | ||
backgroundImage="https://t4.ftcdn.net/jpg/01/09/88/85/240_F_109888581_d2vqgQnNiNkGRfZPFpIYlS5FIYNBD3ch.jpg" | ||
title="Heading" | ||
text="This is a short description about the card." | ||
backgroundColor="linear-gradient(135deg, #667eea 0%, #764ba2 100%);" | ||
></MediaCard> |
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.
이 코드는 아래와 같이 self-closing 을 활용하여 변경할 수 있을 것 같아요. 한번 찾아볼까요?
<MediaCard | |
backgroundImage="https://t4.ftcdn.net/jpg/01/09/88/85/240_F_109888581_d2vqgQnNiNkGRfZPFpIYlS5FIYNBD3ch.jpg" | |
title="Heading" | |
text="This is a short description about the card." | |
backgroundColor="linear-gradient(135deg, #667eea 0%, #764ba2 100%);" | |
></MediaCard> | |
<MediaCard | |
backgroundImage="https://t4.ftcdn.net/jpg/01/09/88/85/240_F_109888581_d2vqgQnNiNkGRfZPFpIYlS5FIYNBD3ch.jpg" | |
title="Heading" | |
text="This is a short description about the card." | |
backgroundColor="linear-gradient(135deg, #667eea 0%, #764ba2 100%);" | |
/> |
font-size: 45px; | ||
color: ${(props) => (props.fColor ? props.fColor : "black")}; | ||
`; | ||
|
||
const ColorWrapper = styled.div` | ||
height: 350px; | ||
border: 1px solid black; | ||
border-top: 0; | ||
border-left: 0; | ||
border-right: 0; | ||
border-top-left-radius: 10px; | ||
border-top-right-radius: 10px; | ||
background-color: ${(props) => (props.bColor ? props.bColor : "black")}; | ||
`; |
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.
지금은 혼자 개발하지만, 다른 개발자와 협업을 하게 될 경우 축약하여 네이밍 하는 경우 그 의미를 정확히 전달하기 어려워지는데요, fColor
를 fontColor
로, bColor
를 backgroundColor
로 명확히 작성하면 더 훌륭한 코드가 될 것 같아요 👍👍
1번
2번
3번