Skip to content
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

Open
wants to merge 2 commits into
base: 이은정
Choose a base branch
from

Conversation

eunjung0301
Copy link

@eunjung0301 eunjung0301 commented May 14, 2022

이은정 3주차 완성했습니다:)

2022-05-14 16 49 43

Copy link

@devHudi devHudi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

영화를 주제로 개발해주셨군요 ㅎㅎ! 저도 조커 참 재밌게 보았던 기억이 있네요.
지난주 과제 때 보다 훨씬 성장하신 것 같아요 👍
몇가지 수정하면 좋을 만한 점을 코멘트 달아드렸어요. 반영해주셔도 좋고, 참고만 해주셔도 좋습니다 😁

Comment on lines +31 to +35
// const media = [
// { img: "/img/B1.jpg", head: "test1" },
// { img: "/img/C1.jpg", head: "test2" },
// { img: "/img/D1.jpg", head: "test3" },
// ];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용하지 않는 주석은 제거할까요? 😎

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!!:)

Comment on lines +75 to +77
{/* {media.map((m) => (
<MediaCard image={m.img} head={m.head}></MediaCard>
))} */}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마찬가지로 사용하지 않는 주석은 제거하는게 좋을 것 같아요.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵!:)

Comment on lines +64 to +68
<Wrapper3>
<Wrapper2>
<MediaCard image="/img/B1.jpg" head="Joker" />
<MediaCard image="/img/C1.jpg" head="Oneday" />
<MediaCard image="/img/D1.jpg" head="Eternal Sunshine" />
Copy link

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);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

디버깅을 위한 코드는 제거해주세요!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!

Comment on lines +4 to +19
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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 Image 컴포넌트는 단순히 props 를 받아 그대로 StyledImage 에게 전달하는 역할만을 하고 있는데요,

Suggested change
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;

위와 같이 코드를 개선하면 더 가독성이 높아질 수 있겠군요 🧐

Copy link
Author

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}
>
{" "}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용되지 않는 공백 같아요 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피드백 감사합니다!! 4주차에서 활용해서 코드 짜볼께요:)

Comment on lines +23 to +25
font_weight={props.fontWeight}
font_size={props.fontSize}
background_color={props.backgroundColor}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

props의 네이밍 컨벤션이 camelCase가 아니라 snake_case를 사용하고 있군요.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이부분은 한번 찾아봐야겠네요!

Comment on lines +13 to +18
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")};
`;
Copy link

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4주차 과제에서 활용해보겠습니다!!:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants