-
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.
- Loading branch information
Showing
3 changed files
with
68 additions
and
17 deletions.
There are no files selected for viewing
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,5 +1,56 @@ | ||
import { useEffect, useState } from "react"; | ||
import useFavoriteStorage from "../../hooks/useFavoriteStorage"; | ||
import { getDataPage } from "../../services/axiosService"; | ||
import { Carousel } from "react-bootstrap"; | ||
|
||
const Favourites = () => { | ||
return <h1>Favourites Characters</h1>; | ||
const [items, toggleItem] = useFavoriteStorage("R&M-Characters"); | ||
|
||
const [characters, setCharacters] = useState(null); | ||
|
||
useEffect(() => { | ||
getDataPage() | ||
.then((data) => { | ||
setCharacters((prevData) => { | ||
if (!prevData) return data.results; | ||
else return [...prevData, ...data.results]; | ||
}); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<h1>Favourites Characters</h1> | ||
<Carousel data-bs-theme="dark"> | ||
<Carousel.Item> | ||
<img src="/src/assets/Rick_and_Morty_Error_404.jpg" alt="First slide" /> | ||
<Carousel.Caption> | ||
<h3>First slide label</h3> | ||
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p> | ||
</Carousel.Caption> | ||
</Carousel.Item> | ||
<Carousel.Item> | ||
<img src="/src/assets/Rick_and_Morty.png" alt="Second slide" /> | ||
<Carousel.Caption> | ||
<h3>Second slide label</h3> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> | ||
</Carousel.Caption> | ||
</Carousel.Item> | ||
<Carousel.Item> | ||
<img src="/src/assets/Rick_and_Morty_Home.jpg" alt="Third slide" /> | ||
<Carousel.Caption> | ||
<h3>Third slide label</h3> | ||
<p> | ||
Praesent commodo cursus magna, vel scelerisque nisl consectetur. | ||
</p> | ||
</Carousel.Caption> | ||
</Carousel.Item> | ||
</Carousel> | ||
</> | ||
); | ||
}; | ||
|
||
export default Favourites; |
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