-
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.
alguns ajustes na organização das pastas e api funcionando e pegando …
…os melhores filmes
- Loading branch information
1 parent
df635a9
commit 89f0ff7
Showing
20 changed files
with
88 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
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,5 @@ | ||
import React from "react"; | ||
|
||
export default function FilmesCard(){ | ||
|
||
} |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,46 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import "./home.css"; | ||
import NavBar from "../components/NavBar/NavBar"; | ||
import axios from "axios"; | ||
|
||
export default function Home(){ | ||
|
||
const [melhoresFilmes, setMelhoresFilmes] = useState([]); | ||
|
||
|
||
useEffect(() => { | ||
|
||
const fetchFilmes = async () => { | ||
try{ | ||
const response = await axios.get('https://api.themoviedb.org/3/movie/top_rated?', | ||
{ | ||
params: { | ||
api_key: "05f8482d5927ec34379002150b1c52c7", | ||
}, | ||
}); | ||
setMelhoresFilmes(response.data.results); | ||
} | ||
catch (error){ | ||
console.error(error) | ||
} | ||
}; | ||
fetchFilmes(); | ||
|
||
},[]); | ||
|
||
return( | ||
|
||
<div className="backhome"> | ||
<NavBar /> | ||
<div className="filmes_container"> | ||
<h2>Melhores Filmes:</h2> | ||
<ul> | ||
{melhoresFilmes.length > 0 && melhoresFilmes.map((filme) => ( | ||
<li key={filme.id}>{filme.title}</li> | ||
))} | ||
|
||
</ul> | ||
</div> | ||
</div> | ||
); | ||
}; |
File renamed without changes
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