diff --git a/README.md b/README.md index 94e602e..78695c0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,29 @@ # ๐ŸŽฅ ์™€ํ”Œํ”ผ๋””์•„ ๐ŸŽฅ -๐Ÿง‡[**์™€ํ”Œํ”ผ๋””์•„**](https://d1vexdz72u651e.cloudfront.net/) ๋Š” [**์™“์ฑ ํ”ผ๋””์•„ ์›น์‚ฌ์ดํŠธ**](https://pedia.watcha.com/ko-KR/)์˜ ํด๋ก  ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค! ๊ธฐ์กด์˜ ์™“์ฑ ํ”ผ๋””์•„๋Š” ์˜ํ™”์™€ ์ฑ…, TV ํ”„๋กœ๊ทธ๋žจ์— ๋Œ€ํ•ด ์ถ”์ฒœ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ๊ณ , ์ž์‹ ์˜ ๊ด€๋žŒํ‰๊ณผ ๋ณ„์ ์„ ๊ณต์œ ํ•˜์—ฌ ๋‹ค๋ฅธ ์œ ์ €์™€ ์†Œํ†ตํ•˜๋Š” **์ฝ˜ํ…์ธ  ์ถ”์ฒœ & ์˜๊ฒฌ ์ปค๋ฎค๋‹ˆํ‹ฐ ์›น์„œ๋น„์Šค** ์ž…๋‹ˆ๋‹ค. ์ €ํฌ TEAM6 ํŒ€์›๋“ค์€ ๊ฐœ๋ฐœ๊ธฐ๊ฐ„๊ณผ ์„œ๋กœ์˜ ์—ญ๋Ÿ‰์„ ๊ณ ๋ คํ•˜์—ฌ, ์™€ํ”Œํ”ผ๋””์•„๋ฅผ **์˜ํ™” ์ฝ˜ํ…์ธ ์— ๋Œ€ํ•œ ์˜๊ฒฌ ์ปค๋ฎค๋‹ˆํ‹ฐ ์„œ๋น„์Šค**์— ์ง‘์ค‘ํ•˜๋Š”, ๊ทธ๋Ÿฌ๋‚˜ ํ•ต์‹ฌ์ ์ด๊ณ  ํ•„์ˆ˜์ ์ธ ๊ธฐ๋Šฅ๋“ค์„ ๋‚ด์‹ค ์žˆ๊ฒŒ ์ œ๊ณตํ•˜๋Š” ์›น์„œ๋น„์Šค๋กœ ์™„์„ฑํ•˜๊ณ ์ž ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋งŽ์ด ๋ถ€์กฑํ•˜์ง€๋งŒ ์—ด๊ณผ ์„ฑ์„ ๋‹คํ•ด ์ œ์ž‘ํ•œ ์ €ํฌ ์™€ํ”Œํ”ผ๋””์•„ ์„œ๋น„์Šค๋ฅผ ๋งŒ์กฑ์Šค๋Ÿฝ๊ฒŒ ์‚ฌ์šฉํ•˜์‹ค ์ˆ˜ ์žˆ๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค๐Ÿ™๐Ÿ™ +- ๐Ÿง‡[**์™€ํ”Œํ”ผ๋””์•„**](https://d1vexdz72u651e.cloudfront.net/) ๋Š” [**์™“์ฑ ํ”ผ๋””์•„ ์›น์‚ฌ์ดํŠธ**](https://pedia.watcha.com/ko-KR/)์˜ ํด๋ก  ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค! +- ๊ธฐ์กด์˜ ์™“์ฑ ํ”ผ๋””์•„๋Š” ์˜ํ™”์™€ ์ฑ…, TV ํ”„๋กœ๊ทธ๋žจ์— ๋Œ€ํ•ด ์ถ”์ฒœ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ๊ณ , ์ž์‹ ์˜ ๊ด€๋žŒํ‰๊ณผ ๋ณ„์ ์„ ๊ณต์œ ํ•˜์—ฌ ๋‹ค๋ฅธ ์œ ์ €์™€ ์†Œํ†ตํ•˜๋Š” **์ฝ˜ํ…์ธ  ์ถ”์ฒœ & ์˜๊ฒฌ ์ปค๋ฎค๋‹ˆํ‹ฐ ์›น์„œ๋น„์Šค** ์ž…๋‹ˆ๋‹ค. ์ €ํฌ TEAM6 ํŒ€์›๋“ค์€ ๊ฐœ๋ฐœ๊ธฐ๊ฐ„๊ณผ ์„œ๋กœ์˜ ์—ญ๋Ÿ‰์„ ๊ณ ๋ คํ•˜์—ฌ, ์™€ํ”Œํ”ผ๋””์•„๋ฅผ **์˜ํ™” ์ฝ˜ํ…์ธ ์— ๋Œ€ํ•œ ์˜๊ฒฌ ์ปค๋ฎค๋‹ˆํ‹ฐ ์„œ๋น„์Šค**์— ์ง‘์ค‘ํ•˜๋Š”, ๊ทธ๋Ÿฌ๋‚˜ ํ•ต์‹ฌ์ ์ด๊ณ  ํ•„์ˆ˜์ ์ธ ๊ธฐ๋Šฅ๋“ค์„ ๋‚ด์‹ค ์žˆ๊ฒŒ ์ œ๊ณตํ•˜๋Š” ์›น์„œ๋น„์Šค๋กœ ์™„์„ฑํ•˜๊ณ ์ž ํ•˜์˜€์Šต๋‹ˆ๋‹ค. +- ๋งŽ์ด ๋ถ€์กฑํ•˜์ง€๋งŒ ์—ด๊ณผ ์„ฑ์„ ๋‹คํ•ด ์ œ์ž‘ํ•œ ์ €ํฌ ์™€ํ”Œํ”ผ๋””์•„ ์„œ๋น„์Šค๋ฅผ ๋งŒ์กฑ์Šค๋Ÿฝ๊ฒŒ ์‚ฌ์šฉํ•˜์‹ค ์ˆ˜ ์žˆ๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค๐Ÿ™๐Ÿ™ -๊ฐœ๋ฐœ ๊ธฐ๊ฐ„ : 23.12.28 ~ 24.02.02 +- ๊ฐœ๋ฐœ ๊ธฐ๊ฐ„ : 23.12.28 ~ 24.02.02 -\*๋ณธ ๋ ˆํฌ๋Š” **TEAM6-WEB REPO** ์ด๋ฏ€๋กœ FRONTEND ๊ฐœ๋ฐœ์— ๊ด€ํ•œ ๋‚ด์šฉ์„ ์œ„์ฃผ๋กœ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. +- ๋ณธ ๋ ˆํฌ๋Š” **TEAM6-WEB REPO** ์ด๋ฏ€๋กœ FRONTEND ๊ฐœ๋ฐœ์— ๊ด€ํ•œ ๋‚ด์šฉ์„ ์œ„์ฃผ๋กœ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. -BACKEND ๊ฐœ๋ฐœ์— ๊ด€ํ•ด ๊ถ๊ธˆํ•˜์‹œ๋‹ค๋ฉด? [TEAM6-SERVER REPO](https://github.com/wafflestudio21-5/team6-server) -

+- BACKEND ๊ฐœ๋ฐœ์— ๊ด€ํ•ด ๊ถ๊ธˆํ•˜์‹œ๋‹ค๋ฉด? [TEAM6-SERVER REPO](https://github.com/wafflestudio21-5/team6-server) +

+ +## ๐Ÿท๏ธ ๋ชฉ์ฐจ + +#### 1. [๋ฐฐํฌ ๐Ÿ’ป](#๐Ÿ’ป-๋ฐฐํฌ) + +#### 2. [๊ฐœ๋ฐœํŒ€ & ์—ญํ•  ๋ถ„๋‹ด ๐Ÿ™‹โ€โ™‚๏ธ](#๐Ÿ™‹โ€โ™‚๏ธ-๊ฐœ๋ฐœํŒ€--์—ญํ• -๋ถ„๋‹ด) + +#### 3. [Stacks ๐Ÿ”ง](#๐Ÿ”ง-stacks) + +#### 4. [์ฃผ์š” PAGE & MODAL ์†Œ๊ฐœ๐Ÿ“ƒ](#๐Ÿ“ƒ-์ฃผ์š”-page--modal-์†Œ๊ฐœ) + +#### 5. [๋ชจ๋ฐ”์ผ ๋ฐ˜์‘ํ˜• ๐Ÿ“ฑ](#๐Ÿ“ฑ-๋ชจ๋ฐ”์ผ-๋ฐ˜์‘ํ˜•) + +#### 6. [ํŠน๋ณ„ ๊ธฐ๋Šฅ ๐ŸŽจ](#๐ŸŽจ-ํŠน๋ณ„-๊ธฐ๋Šฅ) ## ๐Ÿ’ป ๋ฐฐํฌ @@ -20,23 +36,13 @@ BACKEND ๊ฐœ๋ฐœ์— ๊ด€ํ•ด ๊ถ๊ธˆํ•˜์‹œ๋‹ค๋ฉด? [TEAM6-SERVER REPO](https://github. ## ๐Ÿ™‹โ€โ™‚๏ธ ๊ฐœ๋ฐœํŒ€ & ์—ญํ•  ๋ถ„๋‹ด -์˜ค์ˆ˜ํ˜„ [@ohsuhyeon0119](https://github.com/ohsuhyeon0119) - -- ํŒ€์žฅ ์—ญํ•  ์ˆ˜ํ–‰ ๋ฐ ์ผ์ • ๊ด€๋ฆฌ -- ์œ ์ € ํŽ˜์ด์ง€ ๋ฐ ์œ ์ € ํ•˜์œ„ ํŽ˜์ด์ง€ ๋””์ž์ธ&๊ธฐ๋Šฅ / ์ธ์ฆ ์„œ๋น„์Šค ๊ตฌํ˜„ -

- -๋ฐ•๋ฏผ์ฒ  [@ComPhyPark](https://github.com/ComPhyPark) +| | | | +| :-----------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: | +| ์˜ค์ˆ˜ํ˜„ | ๋ฐ•๋ฏผ์ฒ  | ์ •์šฐ์ง„ | +| [@ohsuhyeon0119](https://github.com/ohsuhyeon0119) | [@ComPhyPark](https://github.com/ComPhyPark) | [@izone00](https://github.com/izone00) | +| ํŒ€์žฅ ์—ญํ•  ์ˆ˜ํ–‰ ๋ฐ ์ผ์ • ๊ด€๋ฆฌ, ์œ ์ € ํŽ˜์ด์ง€ ๋ฐ ์œ ์ € ํ•˜์œ„ ํŽ˜์ด์ง€ ๋””์ž์ธ&๊ธฐ๋Šฅ / ์ธ์ฆ ์„œ๋น„์Šค ๊ตฌํ˜„ | ๋žœ๋”ฉ ํŽ˜์ด์ง€์™€ ๋ ˆ์ด์•„์›ƒ์˜ ๋””์ž์ธ & ๊ธฐ๋Šฅ ๊ตฌํ˜„, ์›น์„œ๋น„์Šค์˜ ์ „์ฒด์ ์ธ ๋ฒ„๊ทธ ๊ด€๋ฆฌ ๋ฐ ์ˆ˜์ • | ์˜ํ™” ๊ฐœ๋ณ„ ํŽ˜์ด์ง€ ๋ฐ ์ฝ˜ํ…์ธ  ํ•˜์œ„ ํŽ˜์ด์ง€ ๊ตฌํ˜„, ์ถ”๊ฐ€ ์„œ๋น„์Šค (๋‚ด๊ฐ€ ๊ตฌ๊ฒฝํ•œ ์˜ํ™” ๋ชจ์Œ ๋ณด๊ด€ํ•จ) ๊ตฌํ˜„ | -- ๋žœ๋”ฉ ํŽ˜์ด์ง€ ๋””์ž์ธ&๊ธฐ๋Šฅ ๊ตฌํ˜„ -- ์›น์„œ๋น„์Šค์˜ ์ „์ฒด์ ์ธ ๋ฒ„๊ทธ ์ˆ˜์ • -

- -์ •์šฐ์ง„ [izone00](https://github.com/izone00) - -- ์˜ํ™” ๊ฐœ๋ณ„ ํŽ˜์ด์ง€ ๋ฐ ์ฝ˜ํ…์ธ  ํ•˜์œ„ ํŽ˜์ด์ง€๋“ค์— ๋Œ€ํ•œ ์ „๋ฐ˜์ ์ธ ๋””์ž์ธ&๊ธฐ๋Šฅ ๊ตฌํ˜„ -- ์™€ํ”Œํ”ผ๋””์•„๋งŒ์˜ ์ถ”๊ฐ€ ์„œ๋น„์Šค (๋‚ด๊ฐ€ ๊ตฌ๊ฒฝํ•œ ์˜ํ™” ๋ชจ์Œ ๋ณด๊ด€ํ•จ) ๊ตฌํ˜„ -

+ ## ๐Ÿ”ง Stacks diff --git a/src/apis/content.ts b/src/apis/content.ts index ffd43d8..b3df2bf 100644 --- a/src/apis/content.ts +++ b/src/apis/content.ts @@ -5,8 +5,8 @@ import { BASE_API_URL } from "./const"; // ๋‚˜์ค‘์— ๋ฐ”๊พธ๊ธฐ export async function getContentListRequest( - order: string, - accessToken?: string, + choice: string, + accessToken?: string ) { const headers: HeadersInit = accessToken ? { @@ -14,13 +14,18 @@ export async function getContentListRequest( } : {}; - if (order === "box-office") + if (choice === "box-office") return fetch(`${BASE_API_URL}/contentTest/movies/boxoffice/update/`, { method: "GET", headers: headers, }); - - return fetch(`${BASE_API_URL}/contents?order=${order}`, { + if (choice === "recommend") { + return fetch(`${BASE_API_URL}/contents/carousels/2`, { + method: "GET", + headers: headers, + }); + } + return fetch(`${BASE_API_URL}/contents?order=${choice}`, { method: "GET", headers: headers, }); @@ -39,7 +44,7 @@ export async function getContentRequest(movieCD: string, accessToken?: string) { export async function createRatingRequest( movieCD: string, rate: number, - accessToken: string, + accessToken: string ) { return fetch(`${BASE_API_URL}/contents/${movieCD}/rate`, { method: "POST", @@ -56,7 +61,7 @@ export async function createRatingRequest( export async function updateRatingRequest( rateId: number, rate: number, - accessToken: string, + accessToken: string ) { return fetch(`${BASE_API_URL}/contents/rates/${rateId}`, { method: "PUT", diff --git a/src/apis/custom.ts b/src/apis/custom.ts index 1f0b265..96a8253 100644 --- a/src/apis/custom.ts +++ b/src/apis/custom.ts @@ -7,7 +7,6 @@ export function defaultResponseHandler(res: Response) { } export function errorInBodyResponseHandler(res: Response) { if (!res.ok) { - console.log(res); // res.json()์— ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‹ด๊ฒจ ์žˆ์Œ } return res.json(); } diff --git a/src/components/ContentList.tsx b/src/components/ContentList.tsx index e381ff1..d80b882 100644 --- a/src/components/ContentList.tsx +++ b/src/components/ContentList.tsx @@ -21,6 +21,7 @@ export type ContentListProps = { }; function ContentCell(content: MovieType, rank: number) { + console.log(content.title_ko, content.average_rate); return (
  • @@ -109,41 +110,58 @@ export default function ContentList({ title, order }: ContentListProps) { const { accessToken } = useAuthContext(); useEffect(() => { - order === "box-office" - ? getContentListRequest(order, accessToken ?? undefined) - .then(defaultResponseHandler) - .then((data) => { - setContents( - data.map( - (movieRes: { - movie: MovieType; - my_rate: number | null; - rank: number; - }) => { - const movie = movieRes.movie; - return { - ...movie, - poster: movie.poster.replace("http", "https"), - my_rate: movieRes.my_rate - ? { my_rate: movieRes.my_rate } - : null, - }; - } - ) - ); - }) - : getContentListRequest(order, accessToken ?? undefined) - .then(defaultResponseHandler) - .then((data) => { - setContents( - data.map((movie: MovieType) => { + order === "box-office" && + getContentListRequest(order, accessToken ?? undefined) + .then(defaultResponseHandler) + .then((data) => { + console.log("boxoffice : ", data); + setContents( + data.map( + (movieRes: { + movie: MovieType; + my_rate: number | null; + rank: number; + }) => { + const movie = movieRes.movie; return { ...movie, poster: movie.poster.replace("http", "https"), + my_rate: movieRes.my_rate + ? { my_rate: movieRes.my_rate } + : null, }; - }) - ); - }); + } + ) + ); + }); + order === "latest" && + getContentListRequest(order, accessToken ?? undefined) + .then(defaultResponseHandler) + .then((data) => { + console.log(data); + setContents( + data.map((movie: MovieType) => { + return { + ...movie, + poster: movie.poster.replace("http", "https"), + }; + }) + ); + }); + order === "recommend" && + getContentListRequest(order, accessToken ?? undefined) + .then(defaultResponseHandler) + .then((data) => { + const movies = data.movies; + setContents( + movies.map((movie: MovieType) => { + return { + ...movie, + poster: movie.poster.replace("http", "https"), + }; + }) + ); + }); }, [order, accessToken]); function handleRightClick() { diff --git a/src/pages/MainPage.tsx b/src/pages/MainPage.tsx index 4933089..4a0f04f 100644 --- a/src/pages/MainPage.tsx +++ b/src/pages/MainPage.tsx @@ -13,6 +13,10 @@ export default function MainPage() { title: "์ตœ์‹  ์˜ํ™”", order: "latest", }, + { + title: "๐Ÿง‡ TEAM6's PICK", + order: "recommend", + }, ]; return (