From 66412b7788f49def33fc2143f9e1bd5d25bac261 Mon Sep 17 00:00:00 2001 From: Alberto-Duarte Date: Tue, 25 Apr 2023 16:27:11 +0100 Subject: added more things jaja --- src/pages/browse/index.tsx | 116 +++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 61 deletions(-) (limited to 'src/pages/browse') diff --git a/src/pages/browse/index.tsx b/src/pages/browse/index.tsx index 1b85fd3..90c13c2 100644 --- a/src/pages/browse/index.tsx +++ b/src/pages/browse/index.tsx @@ -1,100 +1,94 @@ import { link } from 'fs' import Link from 'next/link' -import { BellIcon, MagnifyingGlassIcon, PlayIcon, InformationCircleIcon, ArrowSmallDownIcon} from '@heroicons/react/24/solid' +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('MOVIES', data.results[0]) - setHeroMovie(data.results[0]) + console.log(data.results) + setHeroMovie(data.results[3]) }) }, []) + useEffect(() => { + fetch(`${baseURL}${requests.fetchTrending}`).then(res => res.json()).then((data) => { + setTrendingMovies(data.results) + }) + }, []) + return ( -
-
+
+
- - Kids - -
- + + Kids + +
+ + + +
+
-
-
+
- SVG image -

MOVIES

+ SVG image +

MOVIES

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

#1 in TV Shows Today

+ SVG image +

#1 in TV Shows Today

-

+

{heroMovie?.overview}

-
- - +
+ +
-
+

Popular on Netflix

-
+
{ - MOVIES.map((movie, index) => ( -
- - -
- ))} + trendingMovies?.map((movie, index) => ( + + ))}
-
-
+
+
+
+
) } - - - -const MOVIES = [ - { - link:'../images/Card.png', - }, - { - link:'../images/Card.png', - }, - { - link:'../images/Card.png', - }, - { - link:'../images/Card.png', - }, - { - link:'../images/Card.png', - }, - { - link:'../images/Card.png', - } -] \ No newline at end of file -- cgit v1.2.3-54-g00ecf