Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a58b97c
build: NextJs 설치
hamo-o Nov 8, 2022
6c2d57f
1.2 SPR
hamo-o Nov 8, 2022
24dfc1a
1.3 Routing
hamo-o Nov 8, 2022
8982f1f
1.4 CSS Modules
hamo-o Nov 8, 2022
efbf220
1.5 Styles JSX
hamo-o Nov 8, 2022
735f087
1.6 Custom App
hamo-o Nov 8, 2022
c775be8
2.0 Pattern
hamo-o Nov 10, 2022
f1fdd7d
2.1 Fetch API
hamo-o Nov 10, 2022
3d6b5dd
2.2 Redirect and Rewrite
hamo-o Nov 10, 2022
3764624
feat: add navbar
hamo-o Nov 10, 2022
6f09c84
design: change home UI
hamo-o Nov 10, 2022
d3a3261
design: change home UI display style
hamo-o Nov 10, 2022
8b09dea
feat:unify api
AlmondBreez3 Nov 10, 2022
40962b0
feat:랜딩페이지
AlmondBreez3 Nov 10, 2022
e390301
feat:design unify 1
AlmondBreez3 Nov 10, 2022
d847955
feat:일단 고쳐본
AlmondBreez3 Nov 11, 2022
59fa31f
design: change banner UI
hamo-o Nov 11, 2022
568e0ba
design: change home UI
hamo-o Nov 11, 2022
a43501a
design: change index UI
hamo-o Nov 11, 2022
7421e27
design: change Layout, NavBar, home, index UI
hamo-o Nov 11, 2022
2cea3a2
css:icon추가
AlmondBreez3 Nov 11, 2022
e4b1457
fix: API_KEY 숨기기
hamo-o Nov 11, 2022
3802eae
design: change img align
hamo-o Nov 11, 2022
877553f
design: add banner text
hamo-o Nov 11, 2022
9bd8e16
feat:랜딩페이지 구현
AlmondBreez3 Nov 11, 2022
c33b39a
Merge branch 'main' of https://github.com/AlmondHam/next-netflix-16th
AlmondBreez3 Nov 11, 2022
079149b
feat:합치기
AlmondBreez3 Nov 11, 2022
5d131a8
Merge branch 'main' of github.com:AlmondHam/next-netflix-16th into ha…
hamo-o Nov 11, 2022
7576a03
fix:랜딩페이지 오류
AlmondBreez3 Nov 12, 2022
8e87385
검색기능 +css
AlmondBreez3 Nov 15, 2022
f80b565
feat:검색 기능 전역적인 정보 불러오기
AlmondBreez3 Nov 15, 2022
5971bde
fix:검색 딜레이
AlmondBreez3 Nov 15, 2022
509918c
feat:footer내용 morepage에 추가
AlmondBreez3 Nov 16, 2022
a53bfb4
옮기기
AlmondBreez3 Nov 16, 2022
185fa5b
feat:모달창 구현
AlmondBreez3 Nov 16, 2022
48562d6
feat: add detail page
hamo-o Nov 16, 2022
016f64e
feat: fetch detail api
hamo-o Nov 16, 2022
e1f308c
feat: detail 전부 Link 걸기
hamo-o Nov 16, 2022
7a20431
feat: add header Link
hamo-o Nov 16, 2022
734aebd
fix:api_key숨기기
AlmondBreez3 Nov 16, 2022
f9f94b7
Merge branch 'hamo-o5' into AlmondB-03
hamo-o Nov 16, 2022
32f8cca
refactor: search 중복 삭제
hamo-o Nov 16, 2022
5c161ae
fix:404에러 고치기
AlmondBreez3 Nov 16, 2022
4145589
fix: searh input값 없을 때 오류 해결
hamo-o Nov 16, 2022
608ec8b
feat: add youtube 예고편
hamo-o Nov 16, 2022
22d56b1
fix: navBar jsx 수정
hamo-o Nov 18, 2022
d503b29
refactor: header component 분리, css 오류 해결중
hamo-o Nov 18, 2022
3d3a3a5
feat: add tvShows page
hamo-o Nov 18, 2022
9984f82
build: 무한스크롤에 필요한 모듈 설치
hamo-o Nov 18, 2022
43277a2
feat: 무한스크롤 구현중
hamo-o Nov 18, 2022
a8e42d0
feat: 무한스크롤 구현중
hamo-o Nov 18, 2022
20e0f15
feat: 무한스크롤 구현중
hamo-o Nov 18, 2022
1194164
feat: 무한스크롤 구현중
hamo-o Nov 18, 2022
bb2b79d
fix: 무한스크롤 기능 수정
hamo-o Nov 18, 2022
6d558f1
add img in comming-soon page && add Header
hamo-o Nov 19, 2022
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
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
9 changes: 9 additions & 0 deletions nextjs-intro/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": ["next/babel"],
"plugins": [
[
"styled-components",
{ "ssr": true, "displayName": true, "preprocess": false }
]
]
}
3 changes: 3 additions & 0 deletions nextjs-intro/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/babel", "next/core-web-vitals"]
}
37 changes: 37 additions & 0 deletions nextjs-intro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel
.env

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions nextjs-intro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# NextJS Introduction
52 changes: 52 additions & 0 deletions nextjs-intro/components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from 'react';

import styled from 'styled-components';
import Link from 'next/link';

const Header = () => {
return (
<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>
);
Comment on lines +8 to +22
Copy link

Choose a reason for hiding this comment

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

헤더 버튼을 눌렀을때의 기능..! 저도 구현해보고싶다고 생각만 했었는데 직접 실천에 옮기신 분이 계셨더니.. 존경합니다

};

const HeaderWrapper = styled.div`
width: 375px;
padding: 1.5rem;

position: relative;

display: flex;
justify-content: space-around;
align-items: center;

color: white;

position: fixed;
`;

const BannerTag = styled.div`
color: white;
font-size: 17.2px;
display: flex;
flex-direction: column;
gap: 0.5rem;
`;

const BannerImg = styled.img`
width: 2.5rem;
`;

export default React.memo(Header);
Copy link

Choose a reason for hiding this comment

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

React.memo !! 말로만 들었는데 사용되는 모습 보고 배워갑니다 !

20 changes: 20 additions & 0 deletions nextjs-intro/components/Layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import styled from 'styled-components';
import NavBar from './NavBar';

export default function Layout({ children }) {
return (
<Container>
<Content>{children}</Content>
<NavBar />
</Container>
);
}

const Container = styled.div`
width: 375px;
`;

const Content = styled.div`
width: 100%;
height: calc(100vh - 48px);
`;
100 changes: 100 additions & 0 deletions nextjs-intro/components/Modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import styled from 'styled-components';

export default function MovieModal({
backdrop_path,
title,
overview,
name,
release_date,
first_air_date,
vote_average,
setModalOpen,
}) {
return (
<Presentation>
<Wrapper_modal>
<Modal>
<Modal_close onClick={() => setModalOpen(false)}>X</Modal_close>
<Modal_poster
src={`https://image.tmdb.org/t/p/original/${backdrop_path}`}
alt="modal__poster-img"
/>

<Modal__content>
<Modal__details>
{release_date ? release_date : first_air_date}
</Modal__details>
<Modal_title>{title ? title : name}</Modal_title>
<Modal_overview>Rating:{vote_average}</Modal_overview>
<Modal_overview>{overview}</Modal_overview>
</Modal__content>
</Modal>
</Wrapper_modal>
</Presentation>
);
}

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

Choose a reason for hiding this comment

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

모달기능..! 최근 웹페이지에 정말 자주 사용되는 기능인데 구현할 엄두를 못냈었어요... 레시피지팀의 멋진 모달을 보며.. 배워갑니다 ㅎㅎ

`;
const Modal_poster = styled.img`
width: 100%;
height: auto;
`;

const Modal__content = styled.div`
padding: 40px;
color: white;
`;
const Modal_title = styled.h2`
padding: 0;
font-size: 40px;
margin: 16px 0;
`;

const Modal__details = styled.p`
font-weight: 600;
font-size: 18px;
`;

const Modal_overview = styled.p`
font-size: 20px;
line-height: 1.5;
`;

const Modal_close = styled.span`
position: absolute;
right: 20px;
top: 20px;
cursor: pointer;
z-index: 1000;
color: white;
`;

const Presentation = styled.div`
z-index: 500;
position: absolute;
`;

const Wrapper_modal = styled.div`
position: fixed;
inset: 0px;
background-color: rgb(0 0 0 / 71%);
-webkit-tap-highlight-color: transparent;
display: flex;
justify-content: center;
`;
9 changes: 9 additions & 0 deletions nextjs-intro/components/MyHead.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Head from 'next/head';

export default function MyHead({ title }) {
return (
<Head>
<title>{title} | Next Movies</title>
Copy link

Choose a reason for hiding this comment

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

헤드 이름도 변경하게 한 부분.. 디테일 너무 잘 살려주신 것 같아요 ㅎㅎ

</Head>
);
}
90 changes: 90 additions & 0 deletions nextjs-intro/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import React from 'react';
import styled from 'styled-components';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faHouse,
faMagnifyingGlass,
faPlay,
faArrowDown,
faBars,
} from '@fortawesome/free-solid-svg-icons';

import Link from 'next/link';
import { useRouter } from 'next/router';

const NavBar = () => {
const router = useRouter();
return (
<Nav>
<Container>
<Link href="/home">
<NavItem current={router.pathname === '/home'}>
<FontAwesomeIcon icon={faHouse} size={'1x'} />
<NavText>Home</NavText>
</NavItem>
</Link>
<Link href="/search">
<NavItem current={router.pathname === '/search'}>
<FontAwesomeIcon icon={faMagnifyingGlass} size={'1x'} />
<NavText>Search</NavText>
</NavItem>
</Link>
<Link href="/comming-soon">
<NavItem current={router.pathname === '/comming-soon'}>
<FontAwesomeIcon icon={faPlay} size={'1x'} />
<NavText>Comming Soon</NavText>
</NavItem>
</Link>
<Link href="/downloads">
<NavItem current={router.pathname === '/downloads'}>
<FontAwesomeIcon icon={faArrowDown} size={'1x'} />
Copy link

Choose a reason for hiding this comment

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

size 값이 1x 로 반복되는데 기본값으로 설정하는 것도 나쁘지 않을 것 같습니다 !

<NavText>Downloads</NavText>
</NavItem>
</Link>
<Link href="/menu">
<NavItem current={router.pathname === '/menu'}>
<FontAwesomeIcon icon={faBars} size={'1x'} />
<NavText>More</NavText>
</NavItem>
</Link>
</Container>
</Nav>
);
};

const Nav = styled.nav`
width: 375px;
height: 48px;

position: fixed;
bottom: 0;
`;

const Container = styled.div`
width: 100%;
height: 100%;

display: flex;
align-items: center;
justify-content: center;
gap: 2.5rem;

background: #121212;
`;

const NavItem = styled.div`
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
color: ${(props) => props.current && 'white'};
`;

const NavText = styled.div`
font-family: 'SF Pro Display';
font-style: normal;
font-weight: 500;
font-size: 8.2px;
`;

export default NavBar;
20 changes: 20 additions & 0 deletions nextjs-intro/components/Wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import styled from 'styled-components';

export default function Wrapper({ children }) {
return <Container>{children}</Container>;
}

const Container = styled.div`
width: 375px;
height: 100vh;
margin-right: 30rem;

display: flex;
flex-direction: column;
align-items: center;

@media screen and (max-width: 767px) {
margin-right: 5.5rem;
}

`;
34 changes: 34 additions & 0 deletions nextjs-intro/hooks/useInput.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useState } from 'react';

export default function useInput() {
const [search, setSearchValue] = useState('');
const [searches, setSearchResults] = useState('');
const NEXT_PUBLIC_API_KEY = process.env.NEXT_PUBLIC_API_KEY;

const handleChange = (e) => {
if (!e.target.value) {
resetChat();
} else {
setSearchValue(e.target.value);
tryOut(e);
}
};

const resetChat = () => {
setSearchValue('');
setSearchResults('');
};

const tryOut = async (e) => {
e.preventDefault();

const movies = await (
await fetch(
`https://api.themoviedb.org/3/search/movie?api_key=${NEXT_PUBLIC_API_KEY}&language=en-US&query=${e.target.value}&include_adult=false`
)
).json();
setSearchResults(movies);
};

return { search, handleChange, resetChat, searches, tryOut };
}
Loading