From 72cf36e033ba794db7982befa45f035b62fa6cd2 Mon Sep 17 00:00:00 2001 From: "Alberto Duarte (PWC)" Date: Mon, 9 Oct 2023 17:32:25 +0100 Subject: Changes --- src/components/Genre.tsx | 27 ------------ src/components/PreviewCard.tsx | 19 --------- src/pages/_app.tsx | 2 +- src/pages/browse/index.tsx | 94 ------------------------------------------ src/pages/index.tsx | 41 ------------------ src/styles/globals.css | 1 + 6 files changed, 2 insertions(+), 182 deletions(-) delete mode 100644 src/components/Genre.tsx delete mode 100644 src/components/PreviewCard.tsx delete mode 100644 src/pages/browse/index.tsx delete mode 100644 src/pages/index.tsx (limited to 'src') diff --git a/src/components/Genre.tsx b/src/components/Genre.tsx deleted file mode 100644 index e63a26a..0000000 --- a/src/components/Genre.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { useEffect, useState } from "react" - -const Genres = ({id}) => { - - const baseURL = 'https://api.themoviedb.org/3' - const API_KEY = '8216fbb9997cd81a67471e6cb5a6f2df' - const [genres, setGenres] = useState() - - useEffect(() => { - fetch(`${baseURL}/movie/${id}?api_key=${API_KEY}`).then((res) => res.json()).then((data) => { - console.log('MOVIE', data.genres) - setGenres(data.genres) - }) - }, []) - - return ( -
- {genres?.map((genre) => { - return ( -
{genre.name}
- ) - })} -
- ) -} - -export default Genres \ No newline at end of file diff --git a/src/components/PreviewCard.tsx b/src/components/PreviewCard.tsx deleted file mode 100644 index 5c4129f..0000000 --- a/src/components/PreviewCard.tsx +++ /dev/null @@ -1,19 +0,0 @@ -const imageURL = 'https://image.tmdb.org/t/p/original'; -import Genre from "./Genre"; -const baseURL ='https://api.themoviedb.org/3/' - -const PreviewCard = ({ movie }) => { - return ( -
-
-
-

- {movie.original_title} -

- -
-
- )} - - -export default PreviewCard \ No newline at end of file diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index e57ed44..c055f25 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,4 +1,4 @@ -import '@prueba/styles/globals.css' +import '../styles/globals.css' import type { AppProps } from 'next/app' export default function App({ Component, pageProps }: AppProps) { diff --git a/src/pages/browse/index.tsx b/src/pages/browse/index.tsx deleted file mode 100644 index 90c13c2..0000000 --- a/src/pages/browse/index.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { link } from 'fs' -import Link from 'next/link' -import { BellIcon, MagnifyingGlassIcon, PlayIcon, ArrowSmallDownIcon} from '@heroicons/react/24/solid' -import { InformationCircleIcon} from '@heroicons/react/24/outline' -import { useEffect, useState } from 'react' -import requests from '../../../services/requests' -import Image from "next/image" -import PreviewCard from '@prueba/components/PreviewCard' - -// import NetflixLogo from '../../../public/images/netflix_logo.svg' -const baseURL ='https://api.themoviedb.org/3/' -const imageURL = 'https://image.tmdb.org/t/p/original' - -export default function Home() { - const [heroMovie, setHeroMovie] = useState() - const [trendingMovies, setTrendingMovies] = useState() - useEffect(() => { - fetch(`${baseURL}${requests.fetchTopRated}`).then(res => res.json()).then((data) => { - console.log(data.results) - setHeroMovie(data.results[3]) - }) - }, []) - useEffect(() => { - fetch(`${baseURL}${requests.fetchTrending}`).then(res => res.json()).then((data) => { - setTrendingMovies(data.results) - }) - }, []) - - return ( -
-
-
- SVG image - Home - TV Shows - Movies - News & Popular - My List - Browse by Language -
-
- - Kids - -
- - - -
- -
-
-
-
- SVG image -

MOVIES

-
-
- {heroMovie?.original_title} -
-
- SVG image -

#1 in TV Shows Today

-
-
-

- {heroMovie?.overview} -

-
-
- - -
-
-
-

Popular on Netflix

-
- { - trendingMovies?.map((movie, index) => ( - - ))} -
-
-
-
-
-
-
- ) -} diff --git a/src/pages/index.tsx b/src/pages/index.tsx deleted file mode 100644 index 0a21d32..0000000 --- a/src/pages/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import Link from "next/link" -import Image from "next/image" - -export default function Home() { - return ( -
-

Netflix

-

Who's watching?

-
- { - USERS.map((user, index) => ( -
- - - -

{user.name}

-
- ))} -
-
- ) -} - -const USERS = [ - { - name:'Alberto', - link:'/browse', - avatar:'https://avatars.dicebear.com/api/male/124.svg' - }, - { - name:'Kids', - link:'/', - avatar:'https://avatars.dicebear.com/api/male/122.svg' - }, - { - name:'Add profile', - link:'/', - avatar:'https://avatars.dicebear.com/api/female/12.svg' - // icon:'...' - } -] \ No newline at end of file diff --git a/src/styles/globals.css b/src/styles/globals.css index 9fbd6c7..ccea7d8 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -22,4 +22,5 @@ body { ::-webkit-scrollbar { width: 0px; + display: none; } \ No newline at end of file -- cgit v1.2.3-54-g00ecf