-
Notifications
You must be signed in to change notification settings - Fork 11
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
6회차 과제 - 허기영 #7
base: main
Are you sure you want to change the base?
6회차 과제 - 허기영 #7
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.
구현하고 싶었던 기능이었는데 기영님이 잘 구현하신 것 같습니다. 참고하겠습니다!
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.
감사합니다!
{title : "대단한 춤이 아니어도 이렇게 무대를 찢을 수 있네 ㅋㅋㅋㅋ", views:159}, | ||
{title : "[엔믹스] 오해원이 추는 나루토춤", views:316} | ||
]; | ||
|
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.
배열을 만들고 map 메서드를 사용하니 코드가 더 깔끔해보여서 좋은 것 같습니다!
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.
감사합니다!
display : flex; | ||
justify-content : space-between; | ||
align-items : center; | ||
position : fixed; |
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.
detail을 신경 쓰신 것이 느껴집니다...!
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.
감사합니다!
Header 고정을 위해 position : fixed 속성을 사용하는 것이 좋았던 방법 같습니다.
background-color : #fff; | ||
color : #000; | ||
} | ||
|
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.
클릭된 카테고리의 색이 변하도록 하는 것은 저도 공부해보고 다시 comment 달겠습니다!
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.
.active 선택자를 활용하는 방법을 찾아보았는데 실행이 제대로 안 되어서 계속 찾아보겠습니다.
저도 이 부분 해결 완료 시 추가 코멘트 달겠습니다!
1. 내가 개발한 기능
우선 저는 컴포넌트를 크게 Header, Category, Main으로 나누었습니다.
Header에는 로고, 검색창, 프로필 등을 배치하였습니다.
Category에는 콘텐츠 타입에 대한 카테고리들을 배치하였습니다.
Main에는 동영상 및 쇼츠를 배치하였습니다.
1) Header
우선 Header는 Logo, SearchBox, Profile 3가지 컴포넌트로 나누어 구성하였습니다.
2) Category
Category는 각 카테고리를 구성하는 CategoryComponent로 구성되어있습니다.
map()
메서드를 사용하여 각 카테고리 종류를 CategoryComponent의 props으로 전달하였습니다.3) Main
Main은 Video와 Shorts 컴포넌트로 구성되어있습니다.
Video와 Shorts는 VideoComponent, ShortsComponent로 구성되어있습니다.
해당 컴포넌트들에서도
map()
메서드를 사용해 하위 컴포넌트들을 구성하였습니다.2. 내가 유의깊게 개발한 부분
우선 앞선 개발 기능에 언급되었던 것과 같이
map()
메서드와 하위 컴포넌트들을 만들어 카테고리, 동영상, 쇼츠에 해당하는 레이아웃을 만들었습니다.추가로 실제 유튜브 웹 페이지에 접속하여 확인해보니 Header의 경우 스크롤을 내리더라도 상단에 고정되도록 하기 위하여
<Header>
컴포넌트에 css 속성을 추가하였습니다.실제로는 동영상이나 쇼츠의 썸네일에 마우스를 올려놓았을 시 자동 재생되지만 이를 대신하기 위하여 썸네일의 크기를 커지도록 하였습니다.
3. 개발하면서 들었던 의문 사항
카테고리들을 클릭할 경우 선택된 카테고리의
background-color
와color
속성을 변하게 하고 싶었으나 이를 제대로 구현하지 못하였습니다.현재는
hover
속성을 사용하여 카테고리에 마우스를 올릴 시 변경이 되도록 하였으나 이 부분에 대해선 다른 분들과 함께 코드 리뷰를 통해 방법을 생각해보았으면 좋겠습니다.추가적으로 styledComponent를 각 컴포넌트마다 사용하는 것과 Css 파일을 생성한 뒤 import하여 여러 파일의 컴포넌트에 적용시키는 방법 중 어떤 것을 사용하는 것이 더 나은 방법인지에 대한 의문이 들었습니다.