-
Notifications
You must be signed in to change notification settings - Fork 10
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주차] Team Buldog 김다희 & 이지인 미션 제출합니다. #15
base: master
Are you sure you want to change the base?
Changes from all commits
d8d1945
09683ee
aeb9628
b97d1fb
7986c9f
1d9533d
5851f5e
e2eb310
7ef2794
6e108ae
3d2679a
f51edf3
63814cb
6d912a0
da57bd7
e650847
884bef0
6bf832f
daa4189
396e052
acfb4de
87e17b5
e7aa2a6
5ad33e3
c886d0d
0a1aae4
e2dd5ed
1a30a03
a7fd88f
dcb4dfc
5ffe34c
bdb3f57
adbb45b
d187927
57a7120
e39ed5b
5976212
a41cdce
7a3b9f9
fd501d1
4f9cfc8
a4ec9a8
0f411bf
cc849c6
f2322d7
dbe0149
4712125
ec4083c
ab092e3
0c8ed24
d170258
3b30736
c2846d1
bebef4a
800e6f3
1582c86
201d8e8
cdfe3b5
f33a7a4
007580b
80e6e47
5d19490
c4a23d6
48a7c00
1dbc8e7
6fb4411
2d47fc6
2573a61
a521046
63b2d02
5156966
d04d2b0
68a0df0
bcccd56
a6c674d
8ca7a51
ccc4371
3cd72e9
c75a47c
80ff729
bc53ab9
d0fe966
09a57f1
7b78d60
9baa23b
6c68820
3b437d3
90cee50
ef70e00
3a10bd3
276d090
dab5391
e666e2e
f13a673
cc2a320
c04915f
8dc6294
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: git push into another repo to deploy to vercel | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: pandoc/latex | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install mustache (to update the date) | ||
run: apk add ruby && gem install mustache | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' # Ensuring compatibility with Node.js 20 | ||
- name: creates output | ||
run: sh ./build.sh | ||
- name: Pushes to another repository | ||
id: push_directory | ||
uses: cpina/github-action-push-to-another-repository@master | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.DEPLOY_TOKEN }} | ||
with: | ||
source-directory: 'output' | ||
destination-github-username: jinnyleeis | ||
destination-repository-name: next-netflix-19th-deploy | ||
user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }} | ||
commit-message: ${{ github.event.commits[0].message }} | ||
target-branch: master | ||
- name: Test get variable exported by push-to-another-repository | ||
run: echo $DESTINATION_CLONED_DIRECTORY | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
self.__INTERCEPTION_ROUTE_REWRITE_MANIFEST="[]" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": 3, | ||
"middleware": {}, | ||
"functions": {}, | ||
"sortedMiddleware": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"node": {}, | ||
"edge": {}, | ||
"encryptionKey": "qMpyjAhXxmdrHK1j19c0PV7I790xFLpFV8ADrmH4K6o=" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type": "module"} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 저도 관련 내용 공부한거 남기고 갑니다!!
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TMDB_API_KEY=306b2f5b5d2eec206b28b7a4018fef5d |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
semi: true, | ||
trailingComma: 'all', | ||
singleQuote: true, | ||
printWidth: 100, | ||
tabWidth: 2, | ||
plugins: ['prettier-plugin-tailwindcss'], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
import { fetchAllCategories } from '../utils/movieAPI'; | ||
|
||
|
||
|
||
export async function GET(request: NextRequest) { | ||
try { | ||
const movies = await fetchAllCategories(); | ||
return new NextResponse(JSON.stringify(movies), { | ||
|
||
status: 200, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
} catch (error) { | ||
Comment on lines
+7
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try, catch 도 좋지만 ok 상태(movies.ok)로 api fetching 의 성공 유뮤를 파악한 후 분기처리를 해주는 방법도 좋을 것 같아요 ㅎㅎ |
||
console.error('Error fetching movies:', error); | ||
return new NextResponse( | ||
JSON.stringify({ | ||
message: `Failed to fetch data from TMDB.`, | ||
error: (error as Error).message, | ||
}), | ||
{ | ||
status: 500, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}, | ||
); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function CommingSoon() { | ||
return ( | ||
<div> | ||
<main> | ||
<h1 className="mt-[300px] flex justify-center text-[150px]">🎁</h1> | ||
<h1 className=" mt-[5px] flex justify-center text-[40.92px] font-bold"> | ||
Comming Soon! | ||
</h1> | ||
</main> | ||
</div> | ||
); | ||
} | ||
|
||
export default CommingSoon; | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다른 페이지들도 센스 있게 아이콘으로 띄워주시네용 👍 |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||||||||||||||||||||
'use client'; | ||||||||||||||||||||||||||||||||||||||||||||
import React from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||
import Image from 'next/image'; | ||||||||||||||||||||||||||||||||||||||||||||
import { Movie } from '../types/movies'; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
interface CarouselProps { | ||||||||||||||||||||||||||||||||||||||||||||
movies: Movie[]; | ||||||||||||||||||||||||||||||||||||||||||||
currentMovieIndex: number; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
function Carousel({ movies, currentMovieIndex }: CarouselProps) { | ||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||
<div className="relative mb-[20px] h-[395px] w-[375px] "> | ||||||||||||||||||||||||||||||||||||||||||||
<div className="w-[375px] h-[415px] overflow-hidden relative"> | ||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 최외곽 |
||||||||||||||||||||||||||||||||||||||||||||
{movies.length > 0 && ( | ||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||
<Image | ||||||||||||||||||||||||||||||||||||||||||||
src={`https://image.tmdb.org/t/p/original${movies[currentMovieIndex].backdrop_path}`} | ||||||||||||||||||||||||||||||||||||||||||||
alt={movies[currentMovieIndex].title} | ||||||||||||||||||||||||||||||||||||||||||||
fill | ||||||||||||||||||||||||||||||||||||||||||||
sizes="100vw" | ||||||||||||||||||||||||||||||||||||||||||||
className="object-cover" | ||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||
{ /* 그라데이션 */} | ||||||||||||||||||||||||||||||||||||||||||||
<div | ||||||||||||||||||||||||||||||||||||||||||||
style={{ | ||||||||||||||||||||||||||||||||||||||||||||
position: 'absolute', | ||||||||||||||||||||||||||||||||||||||||||||
top: 0, | ||||||||||||||||||||||||||||||||||||||||||||
left: 0, | ||||||||||||||||||||||||||||||||||||||||||||
right: 0, | ||||||||||||||||||||||||||||||||||||||||||||
height: '40%', | ||||||||||||||||||||||||||||||||||||||||||||
backgroundImage: 'linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent)', | ||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||
></div> | ||||||||||||||||||||||||||||||||||||||||||||
<div | ||||||||||||||||||||||||||||||||||||||||||||
style={{ | ||||||||||||||||||||||||||||||||||||||||||||
position: 'absolute', | ||||||||||||||||||||||||||||||||||||||||||||
bottom: 0, | ||||||||||||||||||||||||||||||||||||||||||||
left: 0, | ||||||||||||||||||||||||||||||||||||||||||||
right: 0, | ||||||||||||||||||||||||||||||||||||||||||||
height: '40%', | ||||||||||||||||||||||||||||||||||||||||||||
backgroundImage: 'linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent)', | ||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+24
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그라데이션 부분은 따로 컴포넌트로 만들어서 사용해주시면 협업을 할 때 가독성이 좋아질 것 같아요!!
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
></div> | ||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
export default Carousel; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. svg를 불러와서 next/image의 Image의 src에 넣어주는 방법도 좋지만 svg 파일을 컴포넌트처럼 사용할 수 있는 방법이 있더라구요!! 저도 이번에 첨 알았습니다 쓰면서 편하고 좋았어서 한번 참고해보시는거 추천드려요 ㅎㅎ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'use client'; | ||
import React, { useEffect, useState } from 'react'; | ||
import Image from 'next/image'; | ||
import Top10 from '../../public/icons/top10.svg'; | ||
import Plus from '../../public/icons/plus.svg'; | ||
import Info from '../../public/icons/info.svg'; | ||
import Play from '../../public/icons/play.svg'; | ||
import { Movie } from '../types/movies'; | ||
|
||
interface ControllerProps { | ||
movies: Movie[]; | ||
currentMovieIndex: number; | ||
} | ||
|
||
function Controller({ movies, currentMovieIndex }: ControllerProps) { | ||
const [rank, setRank] = useState((currentMovieIndex % 10) + 1); | ||
|
||
useEffect(() => { | ||
setRank((currentMovieIndex % 10) + 1); | ||
}, [currentMovieIndex]); | ||
|
||
const currentMovie = movies[currentMovieIndex]; | ||
|
||
return ( | ||
<div className="mb-[43px] flex w-[375px] flex-col items-center"> | ||
<div className="mb-[11px] flex space-x-[5px]"> | ||
<Image src={Top10} alt="top10" width={15} height={15} /> | ||
{currentMovie && ( | ||
<span className="text-cont1 font-bold"> | ||
#{rank} {currentMovie.title} | ||
</span> | ||
)} | ||
</div> | ||
<div className="flex space-x-[42px]"> | ||
<button className="flex flex-col items-center"> | ||
<Image src={Plus} alt="plus" width={24} height={24} /> | ||
<span className="text-cont2 font-normal">My List</span> | ||
</button> | ||
<button className="flex h-11 w-28 cursor-pointer items-center justify-center gap-2.5 rounded-md border-none bg-[#C4C4C4]"> | ||
<Image src={Play} alt="play" width={18} height={21.6} /> | ||
<span className="text-play font-semibold text-[#000000]">Play</span> | ||
Comment on lines
+39
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 자주 사용되는 색깔에 대해서는 쉬운 네이밍으로 세팅하는 게 좋을 것 같아요 ㅎㅎ https://doyourbestcode.tistory.com/131 제가 Next + Tailwind 를 세팅하는 방식도 살짝 참고만 해보세요~~ |
||
</button> | ||
<button className="flex flex-col items-center"> | ||
<Image src={Info} alt="info" width={24} height={24} /> | ||
<span className="text-cont2 font-normal">Info</span> | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Controller; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Image from 'next/image'; | ||
import logo from '../../public/icons/logos_netflix-icon.svg' | ||
|
||
function Header() { | ||
const Menu = ['Tv Shows' ,'Movies', 'My List'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 그러게요! 배열로 관리할 생각은 따로 못해봤는데 좋은 방법인 것 같습니다 |
||
return ( | ||
<div className='fixed top-[24px] flex justify-center items-center w-[375px] h-[57px] z-50'> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어느정도 스크롤 하면 헤더의 background-color를 설정해준다면 스크롤이 내려왔을 때도 헤더가 더 잘 보일 것 같아요!! |
||
<div className='mr-[25px]'> | ||
<Image | ||
src = {logo} | ||
alt='logo' | ||
width={56.67} | ||
height={57} | ||
/> | ||
</div> | ||
<div className='flex space-x-[25px]'> | ||
{ | ||
Menu.map((menu) => { | ||
return( | ||
<span className='font-normal text-header'key={menu}> | ||
{menu} | ||
</span> | ||
) | ||
} | ||
) | ||
} | ||
</div> | ||
Comment on lines
+16
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .prettierrc파일은 잘 있는데 indent 사이즈가 설정한 것과 다른것 같아요 ! prettierrc가 잘 적용이 안됐을까요? |
||
</div> | ||
) | ||
} | ||
|
||
export default Header |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import Lottie from "react-lottie-player"; | ||
import netflix from "../../public/icons/netflix-landing.json"; | ||
|
||
const LandingLogo = () => { | ||
const router = useRouter(); | ||
return ( | ||
<Lottie | ||
animationData={netflix} | ||
style={{ width: "60%" }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 중간중간 이렇게 style을 지정해주신 부분이 있던데 이유가 궁금해요! |
||
play | ||
loop={false} | ||
onComplete={() => router.push("/main")} | ||
/> | ||
); | ||
}; | ||
|
||
export default LandingLogo; |
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.
팀 레포에 대한 버셀의 요금 부과 정책에 대비하여 Github Actions를 활용해 개인 레포로 옮긴 것 멋집니다 ㅎㅎ
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.
오 자동배포 설정해주셨군요!! 저희도 설정해줬는데 너무 편한 것 같아요