-
Notifications
You must be signed in to change notification settings - Fork 16
[6주차]레시피지 과제 제출합니다 #15
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
base: master
Are you sure you want to change the base?
Conversation
ch9eri
left a 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.
안녕하세요 코드리뷰 파트너 teample의 임채리입니다.
실제 넷플릭스앱처럼 필요한 기능을 대부분 구현하셨네요!! 너무 멋집니다 ...
특히 무한스크롤은 구현하지 못했는데 레시피지팀 코드리뷰를 하며 흐름을 알아갑니다 ...🤩
nextjs-intro/pages/search.js
Outdated
| <SearchForm> | ||
| <SearchForm > | ||
| <SmallImg src='/searchglass.png'></SmallImg> | ||
| <Search value={search} onChange={handleChange} placeholder={"Search for movie"}></Search> |
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.
useInput에서 handleChange함수를 만들어 이렇게 사용하셧군요 ... 커스텀훅을 쓰니 확실히 코드를 읽기 좋네욤 ... !
| </MovieCon> | ||
| </div> | ||
| ))} | ||
| {modalState && <MovieModal {...curMovie} setModalOpen={setModal} />} |
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.
모달창 구현까지 ... 예전에 한번 써봤을 때 좀 복잡했던 기억이 있는데 엄청 깔끔하게 구현하셨네요! 저도 다음에 적용해봐야겠어요 ... 확실히 모달창 있으니까 디테일 페이지에서 뒤로가기 수월하더라구요!! 배포링크 잘봤습니당
| src={`https://image.tmdb.org/t/p/original/${movie.backdrop_path}`} | ||
| src={ | ||
| movie.backdrop_path === null | ||
| ? `/netflix2.png` |
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.
대체이미지로 넷플릭스 로고 ... 조으다 ... 왜 그 생각을 못했징
| export async function getServerSideProps({ params: { id } }) { | ||
| const data = await ( | ||
| await fetch( | ||
| `https://api.themoviedb.org/3/movie/${id}?api_key=${API_KEY}&append_to_response=videos` |
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.
이거 보고 엄청 신기했는데 !!!! 이 api가 있었군요 ... 레시피지 팀은 정말 꼼꼼하게 많은 것을 구현하셨네요!
| @@ -0,0 +1,102 @@ | |||
| import { useEffect } from 'react'; | |||
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.
우와 무한 스크롤 기능 짱이네요!! 어떻게 구현할지 감이 잘 안왔는데 덕분에 잘 알아갑니당 useInView 훅도 처음 봤어요😤
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.
무한스크롤 너무너무 존경합니다....🤍
| <MovieImg | ||
| src={ | ||
| movie.backdrop_path === null | ||
| ? `/netflix2.png` |
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.
오 그냥 엑박 안 뜨게 하고 넷플릭스 이미지로 대체한거 너무 좋네요...!!
YooSeonHo
left a 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.
안녕하세요 팀플 유선호입니다~
특이한 기능을 많이 구현하셔서 보는 재미가 있었습니당
되게 비슷한 듯 다른 점이 많았던 것 같네요 나중에 같이 지식 공유하면 재미있을 거 같아요 ㅎ
nextjs-intro/pages/search.js
Outdated
| export default function search({TopRated}) { | ||
| const {search,handleChange,resetChat } = useInput(""); | ||
| //const [searches, setSearchResults] =useState([]); | ||
| const {search,handleChange,resetChat ,searches} = useInput(""); |
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.
구조 분해 할당 정말 어려운데 잘 쓰시는 거 같아서 부럽습니다~! 한 수 가르쳐 주세용
nextjs-intro/pages/search.js
Outdated
|
|
||
| //searchsms 한단어부터 시작 이걸 async로 넘겨줘서 query값으로 가져오기 | ||
| const data = TopRated.results; | ||
| if (newData === 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.
코드 읽다가 undefined면 어떻게 처리하지? 궁금했는데 맨 위에 올라와보니 아예 if를 쓰고 안에 리턴을 쓰셨네요 저희랑 방법이 달라서 되게 새롭습니당 ㅎㅎㅎ
| return { props: { params } }; | ||
| const API_KEY = process.env.API_KEY; | ||
|
|
||
| export async function getServerSideProps({ params: { params } }) { |
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.
페이지 이름을 이렇게 써도 되는군요! 찾아보니 모든 route를 잡을 떄 쓰는 방법이군요!!!! 넥제 배울 점이 정말 많은 것 같습니돠
seondal
left a 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.
스터디 과제로 냅다 완성형 넷플릭스를 만들어버리신... 다양하고 완성도 높은 기능들 구현하는 모습들을 코드로 볼 수 있어서 영광이였습니다 ! 코드리뷰하면서 강한 동기부여들 얻어갑니다 😆
| <HeaderWrapper> | ||
| <Link href={'/home'}> | ||
| <BannerImg src={`/netflix.png`}></BannerImg> | ||
| </Link> | ||
| <Link href={'/tv-shows'}> | ||
| <BannerTag>TV Shows</BannerTag> | ||
| </Link> | ||
| <Link href={'/movies'}> | ||
| <BannerTag>Movies</BannerTag> | ||
| </Link> | ||
| <Link href={'/my-list'}> | ||
| <BannerTag>My List</BannerTag> | ||
| </Link> | ||
| </HeaderWrapper> | ||
| ); |
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.
헤더 버튼을 눌렀을때의 기능..! 저도 구현해보고싶다고 생각만 했었는데 직접 실천에 옮기신 분이 계셨더니.. 존경합니다
| width: 2.5rem; | ||
| `; | ||
|
|
||
| export default React.memo(Header); |
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.
React.memo !! 말로만 들었는데 사용되는 모습 보고 배워갑니다 !
| const Modal = styled.div` | ||
| position: relative; | ||
| max-width: 500px; | ||
| box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), | ||
| 0px 5px 8px 0px rgba(0, 0, 0, 0.14), 0px 1px 14px 0px rgba(0, 0, 0, 0.12); | ||
| background: #111; | ||
| overflow: hidden; | ||
| border-radius: 8px; | ||
| transition: all 400ms ease-in-out 2s; | ||
| animation: fadeIn 400ms; | ||
| ::-webkit-scrollbar { | ||
| display: none; | ||
| visibility: hidden; | ||
| } | ||
| -ms-overflow-style: none; /* IE and Edge */ | ||
| scrollbar-width: none; |
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.
모달기능..! 최근 웹페이지에 정말 자주 사용되는 기능인데 구현할 엄두를 못냈었어요... 레시피지팀의 멋진 모달을 보며.. 배워갑니다 ㅎㅎ
| export default function MyHead({ title }) { | ||
| return ( | ||
| <Head> | ||
| <title>{title} | Next Movies</title> |
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.
헤드 이름도 변경하게 한 부분.. 디테일 너무 잘 살려주신 것 같아요 ㅎㅎ
| </Link> | ||
| <Link href="/downloads"> | ||
| <NavItem current={router.pathname === '/downloads'}> | ||
| <FontAwesomeIcon icon={faArrowDown} size={'1x'} /> |
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.
size 값이 1x 로 반복되는데 기본값으로 설정하는 것도 나쁘지 않을 것 같습니다 !
| @@ -0,0 +1,102 @@ | |||
| import { useEffect } from 'react'; | |||
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.
무한스크롤 너무너무 존경합니다....🤍
안녕하세요 여러분
이번에 저희는 상세페이지, 검색기능 말고도 추가 기능을 조금 구현해보았어요
(반응형으로 보시면 더 정돈 된 느낌을 받으실 거에용 ㅎㅎ..)
베포링크:
https://next-netflix-16th-second.vercel.app
KEY QUESTIONS
1.
정적라우팅은 직접 경로를 일일히 설정을 해주는 것이고 동적라우팅은 한번 페이지에 따로 설정을 해주면 라우팅 프로토콜을 통해 알아서 계산되어 경로가 정해진다.
이 프로젝트의 정적 라우팅은 pagees폴더 안에다가 js파일을 넣어주면 됬다.
동적라우팅은 마찬가지로 pages폴더 안에 js파일을 넣어주면 되는데, 이름에 []를 해주고 생성해야한다.
2.
Header.js 부분에 대한 렌더링 최적화를 실행 하였습니다. react.memo를 사용해서 무한 스크롤이나 계속해서 렌더링 되는 값이 있을때 리렌더링되는 것을 방지했습니다.
개인적인 느낀점인데...저는 윈도우 쓰고 현영이는 맥북쓰는데 뭔가 다른 부분이 계속 나와서 협업할 때 어려움이 있었습니다 흑흑....이번에도 next한테 괴롭힘 받고 끝난 느낌이지만 이것저것 많이 구현해보아서 나름 뿌듯합니다~!