generated from FGA0138-MDS-Ajax/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from FGA0138-MDS-Ajax/server
canais e times feito
- Loading branch information
Showing
18 changed files
with
187 additions
and
79 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'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<Match[]>([]); | ||
|
||
useEffect(() => { | ||
fetch("http://localhost:8000/api/v2/games/premiere") | ||
.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 ( | ||
<main className="flex flex-col items-center justify-center flex-grow"> | ||
<img | ||
src="https://upload.wikimedia.org/wikipedia/pt/thumb/a/a2/Logo_Premiere_FC_2018.png/1200px-Logo_Premiere_FC_2018.png" | ||
alt="Premiere" | ||
width={200} | ||
height={200} | ||
/> | ||
<div className="space-y-6 text-center"> | ||
<h1 | ||
className={cn( | ||
"text-6xl font-semibold text-white drop-shadow-md", | ||
font.className | ||
)} | ||
> | ||
Premiere | ||
</h1> | ||
<div className="grid grid-cols-2 gap-2"> | ||
{matches.map((match, index) => ( | ||
<CardTimes key={index} match={match} /> | ||
))} | ||
</div> | ||
</div> | ||
</main> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,55 @@ | ||
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'], | ||
weight: ['400'], | ||
subsets: ['latin'], | ||
weight: ['400'], | ||
}); | ||
|
||
export default function Home() { | ||
return ( | ||
<main className="flex flex-col items-center justify-center flex-grow"> | ||
<img src="https://logodetimes.com/times/flamengo/logo-flamengo-2048.png" alt="Flamengo" width={100} height={100} /> | ||
<div className="space-y-6 text-center"> | ||
|
||
<h1 | ||
className={cn( | ||
'text-6xl font-semibold text-white drop-shadow-md', | ||
font.className | ||
)} | ||
> | ||
Flamengo | ||
</h1> | ||
<p className="text-lg text-black"> | ||
Chega de ficar se perguntando onde o jogo do seu time favorito será transmitido | ||
</p> | ||
</div> | ||
</main> | ||
const [matches, setMatches] = useState<Match[]>([]); | ||
|
||
useEffect(() => { | ||
fetch("http://localhost:8000/api/v1/games/flamengo") | ||
.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 ( | ||
<main className="flex flex-col items-center justify-center flex-grow"> | ||
<img src="https://logodetimes.com/times/flamengo/logo-flamengo-2048.png" alt="Flamengo" width={100} height={100} /> | ||
<div className="space-y-6 text-center"> | ||
<h1 | ||
className={cn( | ||
'text-6xl font-semibold text-white drop-shadow-md', | ||
font.className | ||
)} | ||
> | ||
Flamengo | ||
</h1> | ||
<div className="grid grid-cols-2 gap-2"> | ||
{matches.map((match, index) => ( | ||
<CardTimes key={index} match={match} /> | ||
))} | ||
</div> | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,44 @@ | ||
'use client'; | ||
|
||
import Image from 'next/image'; | ||
import { usePathname } from 'next/navigation'; | ||
import { HomeButton } from '@/components/auth/home-button'; | ||
|
||
const Navbar = () => { | ||
const pathname = usePathname(); | ||
|
||
if (pathname === "/home") { | ||
return ( | ||
<nav className="bg-[#005B14] p-3 relative"> | ||
<div className="container mx-auto flex justify-between items-center"> | ||
<div className="container mx-auto flex justify-center items-center"> | ||
<a href={"/"}> | ||
<Image | ||
src="/logoss.png" alt="Logo" width={120} height={120} /> | ||
</a> | ||
</div> | ||
<div className="absolute right-8 top-5 bg-transparent text-black hover:bg-gray-200 text-lg font-semibold py-2 px-4 rounded-lg"> | ||
</div> | ||
</div> | ||
</nav> | ||
); | ||
} | ||
|
||
return ( | ||
<nav className="bg-[#005B14] p-3 relative"> | ||
<div className="container mx-auto flex justify-between items-center"> | ||
<div className="container mx-auto flex justify-center items-center"> | ||
<Image src="/logoss.png" alt="Logo" width={120} height={120} /> | ||
<nav className="bg-[#005B14] p-3 relative"> | ||
<div className="container mx-auto flex justify-between items-center"> | ||
<div className="container mx-auto flex justify-center items-center"> | ||
<a href={"/"}> | ||
<Image | ||
src="/logoss.png" alt="Logo" width={120} height={120} /> | ||
</a> | ||
</div> | ||
<div className="absolute right-8 top-5 bg-transparent text-black hover:bg-gray-200 text-lg font-semibold py-2 px-4 rounded-lg"> | ||
<HomeButton mode="redirect">Home</HomeButton> | ||
</div> | ||
</div> | ||
<div className="absolute right-8 top-5 bg-transparent text-black hover:bg-gray-200 text-lg font-semibold py-2 px-4 rounded-lg"> | ||
<HomeButton mode="redirect">Home</HomeButton> | ||
</div> | ||
</div> | ||
</nav> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default Navbar; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters