-
Notifications
You must be signed in to change notification settings - Fork 9
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
[이은정] 3주차 #3
base: 이은정
Are you sure you want to change the base?
The head ref may contain hidden characters: "\uC774\uC740\uC815"
[이은정] 3주차 #3
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.
영화를 주제로 개발해주셨군요 ㅎㅎ! 저도 조커 참 재밌게 보았던 기억이 있네요.
지난주 과제 때 보다 훨씬 성장하신 것 같아요 👍
몇가지 수정하면 좋을 만한 점을 코멘트 달아드렸어요. 반영해주셔도 좋고, 참고만 해주셔도 좋습니다 😁
// const media = [ | ||
// { img: "/img/B1.jpg", head: "test1" }, | ||
// { img: "/img/C1.jpg", head: "test2" }, | ||
// { img: "/img/D1.jpg", head: "test3" }, | ||
// ]; |
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.
넵!!:)
{/* {media.map((m) => ( | ||
<MediaCard image={m.img} head={m.head}></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.
마찬가지로 사용하지 않는 주석은 제거하는게 좋을 것 같아요.
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.
네넵!:)
<Wrapper3> | ||
<Wrapper2> | ||
<MediaCard image="/img/B1.jpg" head="Joker" /> | ||
<MediaCard image="/img/C1.jpg" head="Oneday" /> | ||
<MediaCard image="/img/D1.jpg" head="Eternal Sunshine" /> |
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.
다른 개발자와 협업을 할 때, Wrapper
, Wrapper2
, Wrapper3
각각의 컴포넌트의 특성과 차이를 이름만 보고 예상할 수 있을까요? 좋은 컴포넌트 네이밍이란 무엇일까요? 정답은 없습니다 😁
`; | ||
|
||
const Button = (props) => { | ||
console.log(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.
디버깅을 위한 코드는 제거해주세요!
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.
넵!
const StyledImage = styled.img` | ||
position: relative; | ||
object-fit: cover; | ||
width: ${(props) => (props.width ? props.width : "16px")} ; | ||
height: ${(props) => (props.height ? props.height : "16px")} ; | ||
`; | ||
|
||
const Image = (props) => { | ||
return ( | ||
<StyledImage src={props.Image} width={props.width} height={props.height}> | ||
{props.children} | ||
</StyledImage> | ||
); | ||
}; | ||
|
||
export default Image; |
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.
여기서 Image
컴포넌트는 단순히 props 를 받아 그대로 StyledImage
에게 전달하는 역할만을 하고 있는데요,
const StyledImage = styled.img` | |
position: relative; | |
object-fit: cover; | |
width: ${(props) => (props.width ? props.width : "16px")} ; | |
height: ${(props) => (props.height ? props.height : "16px")} ; | |
`; | |
const Image = (props) => { | |
return ( | |
<StyledImage src={props.Image} width={props.width} height={props.height}> | |
{props.children} | |
</StyledImage> | |
); | |
}; | |
export default Image; | |
const Image = styled.img` | |
position: relative; | |
object-fit: cover; | |
width: ${(props) => (props.width ? props.width : "16px")} ; | |
height: ${(props) => (props.height ? props.height : "16px")} ; | |
`; | |
export default Image; |
위와 같이 코드를 개선하면 더 가독성이 높아질 수 있겠군요 🧐
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.
넵! 참고하겠습니당:)
font_size={props.fontSize} | ||
background_color={props.backgroundColor} | ||
> | ||
{" "} |
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.
피드백 감사합니다!! 4주차에서 활용해서 코드 짜볼께요:)
font_weight={props.fontWeight} | ||
font_size={props.fontSize} | ||
background_color={props.backgroundColor} |
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.
props의 네이밍 컨벤션이 camelCase가 아니라 snake_case를 사용하고 있군요.
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.
이부분은 한번 찾아봐야겠네요!
border-radius: 0.25rem; | ||
background-color: ${(props) => | ||
props.backgroundColor ? props.backgroundColor : "white"}; | ||
color: ${(props) => (props.color ? props.color : "black")}; | ||
border-color: ${(props) => (props.borderColor ? props.borderColor : "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.
기본값을 위해 삼항연산자가 반복적으로 사용되고 있는데요, 아래와 같은 방법으로 코드를 좀 더 축약해볼 수 있을 것 같아요.
AS-IS
color: ${(props) => props.color ? props.color : "#212529"};
TO-BE
color: ${(props) => props.color || "#212529"};
이를 단축 평가 (Short circuit evaluation) 이라고 합니다. (참고: http://milooy.github.io/TIL/JavaScript/short-circuit.html#%E1%84%8B%E1%85%A8%E1%84%8C%E1%85%A6)
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.
4주차 과제에서 활용해보겠습니다!!:)
이은정 3주차 완성했습니다:)