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

[6주차] Hooking 미션 제출합니다. #13

Open
wants to merge 109 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
174e4b2
initial commit
moong23 May 10, 2023
3d6cf7a
initializing project
moong23 May 10, 2023
bb1d51a
initializing project: directory 구조 세팅 및 styledcomponent 세팅
moong23 May 10, 2023
0ac915e
feat: svg file 사용 위한 모듈과 setting 변경
moong23 May 10, 2023
17db110
feat: navbar 완료
moong23 May 10, 2023
9da0af9
refactor: removing non-using props
moong23 May 10, 2023
4b60080
Merge pull request #1 from Hooking-CEOS/feature/navbar
moong23 May 10, 2023
5f18ea1
initialize: initializing genreList structure and branch
moong23 May 10, 2023
6e21bbf
feat: scrollbar view disabled
moong23 May 10, 2023
bb9448e
feat: genreList hard coding on index.js
moong23 May 10, 2023
d9962ba
feat: genreList itself content
moong23 May 10, 2023
c45291e
chore: item added for test
moong23 May 10, 2023
bbad972
Merge pull request #2 from Hooking-CEOS/feature/genre_list
moong23 May 10, 2023
f6766ce
initialize: initializing landing_page structure and branch
moong23 May 10, 2023
60219de
feat: landing page 끗
moong23 May 10, 2023
1fcba9a
Merge pull request #3 from Hooking-CEOS/feature/landing_page
moong23 May 10, 2023
0fa8c76
feat: 헤더 추가
May 10, 2023
2919a71
feat: mainContent 컴포넌트 추가
May 10, 2023
bac6805
style: global-style, theme 추가
May 10, 2023
b4de2d4
Merge pull request #4 from Hooking-CEOS/feature/header
hyosin-Jang May 10, 2023
1975baf
feat: controlPanel 컴포넌트 추가
May 10, 2023
695c3f0
feat: index.js에 상단 컴포넌트들 추가
May 10, 2023
cac7e00
fix: z-index 쌓임 스택 어긋나는 에러 수정
May 10, 2023
b76fd37
Merge pull request #5 from Hooking-CEOS/feature/controlPanel
hyosin-Jang May 10, 2023
a9d1e02
chore: 색상 theme으로 분리
May 11, 2023
a2a306b
chore: 색상 수정
May 11, 2023
cc406ed
feat: api_connection wwith img datas
moong23 May 11, 2023
f70915a
Merge pull request #6 from Hooking-CEOS/feature/api_connection
moong23 May 11, 2023
b016110
Merge pull request #7 from Hooking-CEOS/dev
moong23 May 11, 2023
1ecbabf
fix: api https issue fixed
moong23 May 11, 2023
a05a152
Merge pull request #8 from Hooking-CEOS/fix/api_issue
moong23 May 11, 2023
cd086bb
Merge pull request #9 from Hooking-CEOS/dev
moong23 May 11, 2023
7ff8609
fix: api index page modified
moong23 May 11, 2023
97834b8
Merge pull request #10 from Hooking-CEOS/fix/api_issue
moong23 May 11, 2023
1c36ec0
refactor: img 태그 Next/Image 태그로 변경 및 css 수정
moong23 May 12, 2023
ee65dc1
Merge pull request #11 from Hooking-CEOS/refactor/image
moong23 May 12, 2023
fb9defb
refactor: panel width 수정 및 panel 자식에 flex-basis 설정
moong23 May 12, 2023
7ae08ac
WIP: scroll function adding in progress
moong23 May 12, 2023
095890d
Merge pull request #12 from Hooking-CEOS/refactor/panel
moong23 May 12, 2023
82ccab4
Merge pull request #13 from Hooking-CEOS/dev
moong23 May 12, 2023
f743fa2
feat: scroll시 위 헤더 invisible
moong23 May 12, 2023
4ba3670
Merge pull request #14 from Hooking-CEOS/feature/header_vanish
moong23 May 12, 2023
2447432
chore: play버튼 가운데정렬 / navbar 호버 해제 css
moong23 May 12, 2023
d2b4229
Merge pull request #15 from Hooking-CEOS/chore/minor_bug_fix
moong23 May 12, 2023
299ce68
Merge pull request #16 from Hooking-CEOS/dev
moong23 May 12, 2023
01f5078
refactor: index.js 반복되는 코드 정리및 minor bug fix
moong23 May 12, 2023
fb29777
Merge pull request #17 from Hooking-CEOS/chore/minor_bug_fix
moong23 May 12, 2023
b04c523
Merge pull request #18 from Hooking-CEOS/dev
moong23 May 12, 2023
34321ed
refactor: html부분 정리
moong23 May 12, 2023
8b7e85a
refactor: css정리및 중복코드 제거
moong23 May 12, 2023
4ad656e
Merge pull request #19 from Hooking-CEOS/dev
moong23 May 12, 2023
84ca1a3
feat: url rewrites를 통해 api_key 숨기기
moong23 May 12, 2023
83f1690
feat: uuid의 v1()을 통해 recoil id 중복 방지
moong23 May 12, 2023
1f3d0f1
Merge pull request #20 from Hooking-CEOS/refactor
moong23 May 12, 2023
ec3720d
Merge pull request #21 from Hooking-CEOS/dev
moong23 May 12, 2023
417e9d5
fix: opacity 적용한 timeout함수 로직 수정
moong23 May 12, 2023
a062b17
Merge pull request #22 from Hooking-CEOS/dev
moong23 May 12, 2023
c646cc9
docs: Update README.md
moong23 May 12, 2023
1b76b78
Merge pull request #23 from Hooking-CEOS/master
moong23 May 12, 2023
987b782
[chore]: 불필요한 파일 삭제
moong23 May 15, 2023
89e53cd
fix: mainContent에 type 부여해서 확장
moong23 May 15, 2023
b40ecad
Merge pull request #24 from Hooking-CEOS/fix/mainContent
moong23 May 15, 2023
3b39660
[etc]: 주석 작성
moong23 May 16, 2023
3a72d50
[refactor]: navbar에 필요없는 state제거, render 로직 수정
moong23 May 16, 2023
2cf62d2
[WIP] - Merge pull request #25 from Hooking-CEOS/fix/mainContent
moong23 May 16, 2023
2fdf249
feat: react-query 세팅
May 18, 2023
598669d
feat: searchbar 컴포넌트 추가
May 18, 2023
cde8301
feat: 키워드 검색, 검색 페이지 리스트 무한스크롤 쿼리 추가
May 18, 2023
d779bea
feat: movieCard 컴포넌트 추가
May 18, 2023
6c44ee9
feat: spacing, layout 컴포넌트 추가
May 18, 2023
39a139e
feat: 스켈레톤 추가
May 18, 2023
5dba080
feat: status에 따라 ui 분기처리
May 18, 2023
8f02b09
feat: target 위치 감지하는 useObserver훅 추가
May 18, 2023
ddc42a9
fix: 불필요한 스타일 제거
May 18, 2023
ca144c1
style: input 기본 스타일, 말줄임 스타일 추가
May 18, 2023
71c0b2c
feat: useInput 훅 추가
May 18, 2023
65a62dc
feat: constants 추가
May 18, 2023
13133dd
fix: navbar 충돌 해결
May 18, 2023
99283dd
[feat]: playButton 컴포넌트화
moong23 May 19, 2023
6d16d7e
[feat]: navigation 기능 추가
moong23 May 19, 2023
6d96ef8
[style]: style.css수정 및 사소한 style 수정
moong23 May 19, 2023
dd2345d
[feat]: mainContent 로직 수정
moong23 May 19, 2023
4773b52
[feat]: movieData 컴포넌트 추가
moong23 May 19, 2023
61eeab5
[WIP]: 주석 추가 및 TODO 정리
moong23 May 19, 2023
7f88498
[feat]: [id].js로 동적 라우팅 및 컴포넌트 렌더링
moong23 May 19, 2023
32fe444
Merge pull request #26 from Hooking-CEOS/fix/mainContent
moong23 May 19, 2023
5a24aed
fix: movie search api rewrites 추가
May 19, 2023
faa256d
fix: api url 수정
May 19, 2023
3b0646c
chore: layout head 태그 추가
May 19, 2023
1cc320f
fix: 상세페이지 detail/:id로 이동
May 19, 2023
a855ddc
feat: nav link 추가
May 19, 2023
2347ef5
chore: imgSrc constants로 분리
May 19, 2023
d87401f
[refactor]: index.js에 ISR적용 (24시간)
moong23 May 19, 2023
20f9b50
feat: ssr 적용 (진행중)
May 19, 2023
b5da87b
Merge pull request #27 from Hooking-CEOS/refactor/SSR,ISR
moong23 May 19, 2023
8c8508f
Merge branch 'feature/search' of https://github.com/Hooking-CEOS/next…
moong23 May 19, 2023
6a5b0ce
Merge pull request #28 from Hooking-CEOS/feature/search
moong23 May 19, 2023
dd63197
[WIP]: test
moong23 May 19, 2023
67525ee
Merge pull request #29 from Hooking-CEOS/test/ssr_test
moong23 May 19, 2023
7826082
fix: ssr 적용
May 19, 2023
5f494d4
fix: 같은 데이터만 불러오는 에러 수정
May 19, 2023
e18deb1
[feat]: ISR added to [id].js
moong23 May 19, 2023
cd53782
[feat]: skeleton structure added to movieData and mainContent
moong23 May 19, 2023
95281ca
Merge pull request #30 from Hooking-CEOS/feature/search
moong23 May 19, 2023
7c9c8ed
[Comment]: Added Annotations on Code
moong23 May 19, 2023
7faf032
[fix]: URL encoding via rewrites
moong23 May 19, 2023
afa1b1f
[fix]: Fixed randomizing poster logic
moong23 May 19, 2023
44e24a2
[fix]: Replacing Image on Error (404)
moong23 May 19, 2023
c3d63c8
Merge pull request #31 from Hooking-CEOS/dev
moong23 May 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions components/movieCard/movieCard.element.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import styled from "styled-components";

export const Wrapper = styled.div`
display: flex;
align-items: center;
width: 100%;
height: 76px;
padding-right: 20px;
color: white;
background-color: #424242;

& + & {
margin-top: 10px;
}

.skeleton {
display: flex;

&-poster {
width: 146px;
height: 76px;
background-color: #2e313d;
}

&-text {
width: 150px;
height: 20px;
margin: 10px;
background-color: #2e313d;
flex: 1;
}

&-play {
border-radius: 50%;
background-color: #2e313d;
width: 30px;
height: 30px;
}
}
`;

export const MovieName = styled.span`
padding: 20px;
width: 150px;
`;
49 changes: 49 additions & 0 deletions components/movieCard/movieCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Link from "next/link";
import Image from "next/image";
import { useState, useRef } from "react";
import { Wrapper, MovieName } from "./movieCard.element";
import { FaRegPlayCircle } from "react-icons/fa";
import { LazyLoadImage } from "react-lazy-load-image-component";
import { useObserver } from "../../hooks/useObserver";
import useLocalStorage from "use-local-storage";

const MovieCard = ({ id, title, poster }) => {
let imgSrc = "https://image.tmdb.org/t/p/w500";

const [visible, setVisible] = useState(false);
const [scrollY, setScrollY] = useLocalStorage("movie_list_scroll", 0);
const target = useRef(null);

// DOM이 뷰포트 안에 보이는 경우에만 렌더링함
const onIntersect = ([entry]) =>
entry.isIntersecting ? setVisible(true) : setVisible(false);

// threshold: 화면 양끝에서 10%만 보여줘도 onIntersect callback을 실행함
useObserver({ target, onIntersect, threshold: 0.1 });

return (
<Wrapper ref={target}>
{visible && (
<>
{/* Image보다 LazyLoadImage가 체감 속도가 빨라서 일단 이걸로 썼음 */}
<LazyLoadImage
Copy link

Choose a reason for hiding this comment

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

옹,,, next/Image를 사용했는데, LazyLoadImage도 있군요,, 배워갑니다!!

alt={title}
src={imgSrc + poster}
style={{ objectFit: "cover" }}
width="146"
height="76"
/>
<MovieName className="text-ellipsis">{title}</MovieName>
<Link href={`/search/${id}`}>
<FaRegPlayCircle
size={20}
onClick={() => setScrollY(window.scrollY)}
/>
</Link>
</>
)}
</Wrapper>
);
};

export default MovieCard;