[6주차 과제] 영화 목록 사이트 만들기#9
Open
hdg0116 wants to merge 57 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 과제
any사용 금지✍️ 구현 요약 및 새로 배운 점
이번 과제에서는 합세를 하면서 배운 것들(폴더 구조, API 렌더링 구조 등)을 최대한 녹여내려고 했던 것 같습니다.
전체 구조
기존에 구현하던 방식은 폴더 최상위 부분에서 모든걸 공통으로 내려주려고 하는 방식이었는데, 합세 때 배운 폴더구조로 도메인별로 각 컴포넌트와 API 호출을 나눠서 구현했습니다. 그리고 Axios 인스턴스에 API 키를 인터셉터로 자동 주입하는 방식으로 API 통신 계층을 분리했습니다.
이렇게 구현하니 props가 훨씬 줄어들고, 파일별 책임도 가벼워져 코드의 뜻을 잘 파악할 수 있게 된 것 같습니다.
메인 페이지
useInfiniteQuery+IntersectionObserver로 무한 스크롤을 구현했습니다.영화 상세 페이지
HeroSection,InfoSection,OverviewSection,RatingSection으로 섹션 분리 후 각 섹션별로 사용되는 API만 각각 호출하도록 구현했습니다.useParams로 영화 ID를 추출하고 목록으로 돌아가기 버튼 클릭 시useNavigate('/')로 영화 목록 페이지로 이동하도록 구현했습니다.별점 기능
게스트 세션 발급
별점 저장 / 수정
별점 삭제
💦 구현 과정에서 어려웠던 & 고민했던 부분
🙋♀️ 리뷰 요청 포인트 & 질문
📷 결과물
https://internal-beach-57c.notion.site/6-37271b55803980c59ed8c9d4a47cff50?source=copy_link