From 16450b8e7149c5643ef5d425a2fd090baed2b220 Mon Sep 17 00:00:00 2001 From: nanecapde Date: Sun, 30 Jun 2024 20:04:18 -0300 Subject: [PATCH 1/4] =?UTF-8?q?p=C3=A1ginas=20dos=20canais=20feitas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projeto/client/app/home/canais/band/page.tsx | 42 +- .../client/app/home/canais/disney+/page.tsx | 62 + projeto/client/app/home/canais/espn/page.tsx | 46 +- projeto/client/app/home/canais/globo/page.tsx | 41 +- .../app/home/canais/paramount+/page.tsx | 62 + .../client/app/home/canais/premiere/page.tsx | 2 + .../client/app/home/canais/record/page.tsx | 39 +- .../client/app/home/canais/sportv/page.tsx | 43 +- .../client/app/home/canais/youtube/page.tsx | 39 +- projeto/client/app/home/page.tsx | 2 + projeto/client/components/Sidebar.tsx | 24 +- projeto/client/package-lock.json | 1450 ++++++++++++++++- projeto/client/package.json | 1 + .../client/public/{disney+.png => disney.png} | Bin .../public/{paramount+.png => paramount.png} | Bin 15 files changed, 1715 insertions(+), 138 deletions(-) create mode 100644 projeto/client/app/home/canais/disney+/page.tsx create mode 100644 projeto/client/app/home/canais/paramount+/page.tsx rename projeto/client/public/{disney+.png => disney.png} (100%) rename projeto/client/public/{paramount+.png => paramount.png} (100%) diff --git a/projeto/client/app/home/canais/band/page.tsx b/projeto/client/app/home/canais/band/page.tsx index 841b171..35aea86 100644 --- a/projeto/client/app/home/canais/band/page.tsx +++ b/projeto/client/app/home/canais/band/page.tsx @@ -1,6 +1,10 @@ -import React from "react"; +'use client'; + +import React, {useEffect, useState} from "react"; import { Bebas_Neue } from "next/font/google"; import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; const font = Bebas_Neue({ subsets: ["latin"], @@ -8,13 +12,33 @@ const font = Bebas_Neue({ }); export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/band") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); return ( +
Band

- Band TV + Band

-

- Os próximos jogos transmitidos por essa emissora -

+
+ {matches.map((match, index) => ( + + ))} +
+
); } + diff --git a/projeto/client/app/home/canais/disney+/page.tsx b/projeto/client/app/home/canais/disney+/page.tsx new file mode 100644 index 0000000..d7706b5 --- /dev/null +++ b/projeto/client/app/home/canais/disney+/page.tsx @@ -0,0 +1,62 @@ +'use client'; + +import React, {useEffect, useState} from "react"; +import { Bebas_Neue } from "next/font/google"; +import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; + +const font = Bebas_Neue({ + subsets: ["latin"], + weight: ["400"], +}); + +export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/disney+") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); + return ( +
+
+ Disney+ +
+

+ Disney+ +

+
+ {matches.map((match, index) => ( + + ))} +
+
+
+
+ ); +} + diff --git a/projeto/client/app/home/canais/espn/page.tsx b/projeto/client/app/home/canais/espn/page.tsx index eb9dc35..a95635b 100644 --- a/projeto/client/app/home/canais/espn/page.tsx +++ b/projeto/client/app/home/canais/espn/page.tsx @@ -1,6 +1,10 @@ -import React from "react"; +'use client'; + +import React, {useEffect, useState} from "react"; import { Bebas_Neue } from "next/font/google"; import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; const font = Bebas_Neue({ subsets: ["latin"], @@ -8,14 +12,35 @@ const font = Bebas_Neue({ }); export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/espn") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); return ( +
ESPN +

- ESPN + Espn

-

- Os próximos jogos transmitidos por essa emissora -

+
+ {matches.map((match, index) => ( + + ))} +
+
); -} +} \ No newline at end of file diff --git a/projeto/client/app/home/canais/globo/page.tsx b/projeto/client/app/home/canais/globo/page.tsx index 999f449..33a51f3 100644 --- a/projeto/client/app/home/canais/globo/page.tsx +++ b/projeto/client/app/home/canais/globo/page.tsx @@ -1,6 +1,10 @@ -import React from "react"; +'use client'; + +import React, {useEffect, useState} from "react"; import { Bebas_Neue } from "next/font/google"; import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; const font = Bebas_Neue({ subsets: ["latin"], @@ -8,13 +12,33 @@ const font = Bebas_Neue({ }); export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/globo") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); return ( +
Globo

Globo

-

- Os próximos jogos transmitidos por essa emissora -

+
+ {matches.map((match, index) => ( + + ))} +
+
); -} +} \ No newline at end of file diff --git a/projeto/client/app/home/canais/paramount+/page.tsx b/projeto/client/app/home/canais/paramount+/page.tsx new file mode 100644 index 0000000..4ca20d9 --- /dev/null +++ b/projeto/client/app/home/canais/paramount+/page.tsx @@ -0,0 +1,62 @@ +'use client'; + +import React, {useEffect, useState} from "react"; +import { Bebas_Neue } from "next/font/google"; +import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; + +const font = Bebas_Neue({ + subsets: ["latin"], + weight: ["400"], +}); + +export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/paramount+") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); + return ( +
+
+ paramount+ +
+

+ Paramount+ +

+
+ {matches.map((match, index) => ( + + ))} +
+
+
+
+ ); +} + diff --git a/projeto/client/app/home/canais/premiere/page.tsx b/projeto/client/app/home/canais/premiere/page.tsx index 5ca1cb0..7c7d430 100644 --- a/projeto/client/app/home/canais/premiere/page.tsx +++ b/projeto/client/app/home/canais/premiere/page.tsx @@ -32,6 +32,7 @@ export default function Home() { }); }, []); return ( +
+ ); } diff --git a/projeto/client/app/home/canais/record/page.tsx b/projeto/client/app/home/canais/record/page.tsx index 740a625..8ccd3a4 100644 --- a/projeto/client/app/home/canais/record/page.tsx +++ b/projeto/client/app/home/canais/record/page.tsx @@ -1,6 +1,10 @@ -import React from "react"; +'use client'; + +import React, {useEffect, useState} from "react"; import { Bebas_Neue } from "next/font/google"; import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; const font = Bebas_Neue({ subsets: ["latin"], @@ -8,13 +12,33 @@ const font = Bebas_Neue({ }); export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/record") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); return ( +
Record

Record

-

- Os próximos jogos transmitidos por essa emissora -

+
+ {matches.map((match, index) => ( + + ))} +
+
); } diff --git a/projeto/client/app/home/canais/sportv/page.tsx b/projeto/client/app/home/canais/sportv/page.tsx index 0ad0b17..d4b0394 100644 --- a/projeto/client/app/home/canais/sportv/page.tsx +++ b/projeto/client/app/home/canais/sportv/page.tsx @@ -1,6 +1,10 @@ -import React from "react"; +'use client'; + +import React, {useEffect, useState} from "react"; import { Bebas_Neue } from "next/font/google"; import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; const font = Bebas_Neue({ subsets: ["latin"], @@ -8,13 +12,33 @@ const font = Bebas_Neue({ }); export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/sportv") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); return ( +
SporTV

- SporTV + Sportv

-

- Os próximos jogos transmitidos por essa emissora -

+
+ {matches.map((match, index) => ( + + ))} +
+
); } diff --git a/projeto/client/app/home/canais/youtube/page.tsx b/projeto/client/app/home/canais/youtube/page.tsx index 18550d2..f14cc3e 100644 --- a/projeto/client/app/home/canais/youtube/page.tsx +++ b/projeto/client/app/home/canais/youtube/page.tsx @@ -1,6 +1,10 @@ -import React from "react"; +'use client'; + +import React, {useEffect, useState} from "react"; import { Bebas_Neue } from "next/font/google"; import { cn } from "@/lib/utils"; +import {CardTimes} from "@/components/home/card-times"; +import {Match} from "@/models/match"; const font = Bebas_Neue({ subsets: ["latin"], @@ -8,13 +12,33 @@ const font = Bebas_Neue({ }); export default function Home() { + const [matches, setMatches] = useState([]); + + useEffect(() => { + fetch("http://localhost:8000/api/v2/games/youtube") + .then(response => response.json()) + .then(data => { + const matchInstances = data.map((matchData: any) => new Match( + matchData.campeonato, + matchData.data_hora, + matchData.time_1, + matchData.time_2, + matchData.channels + )); + setMatches(matchInstances); + }) + .catch(error => { + console.error('Erro ao buscar os dados:', error); + }); + }, []); return ( +
Youtube

Youtube

-

- Os próximos jogos transmitidos por essa emissora -

+
+ {matches.map((match, index) => ( + + ))} +
+
); } diff --git a/projeto/client/app/home/page.tsx b/projeto/client/app/home/page.tsx index 660cbb7..df47b23 100644 --- a/projeto/client/app/home/page.tsx +++ b/projeto/client/app/home/page.tsx @@ -120,6 +120,7 @@ export default function HomePage() { } return ( +
@@ -159,5 +160,6 @@ export default function HomePage() {
+
); }; \ No newline at end of file diff --git a/projeto/client/components/Sidebar.tsx b/projeto/client/components/Sidebar.tsx index 5f5e35d..0b511bd 100644 --- a/projeto/client/components/Sidebar.tsx +++ b/projeto/client/components/Sidebar.tsx @@ -668,19 +668,7 @@ const Sidebar = () => {