-
Notifications
You must be signed in to change notification settings - Fork 1
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 #51 from Sillen00/41-create-bookmarkpage
41 create bookmarkpage
- Loading branch information
Showing
12 changed files
with
189 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const StyleBookmarkedMovie = styled.div` | ||
padding: 1rem; | ||
a { | ||
text-decoration: none; | ||
} | ||
.empty-bookmark-message { | ||
font-size: 3rem; | ||
text-align: center; | ||
margin: 3rem 0; | ||
font-weight: bold; | ||
} | ||
`; |
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,30 @@ | ||
import { Grid } from "@mantine/core"; | ||
import { useContext } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { MovieContext } from "../../contexts/MovieContext"; | ||
import { titleToSlug } from "../../pages/MovieViewPage"; | ||
import MovieCard from "../MovieCard/MovieCard"; | ||
import { StyleBookmarkedMovie } from "./BookmarkedMovies.style"; | ||
|
||
function BookmarkedMovies() { | ||
const { bookmarkedMovies } = useContext(MovieContext); | ||
|
||
return ( | ||
<StyleBookmarkedMovie> | ||
{bookmarkedMovies.length === 0 && ( | ||
<p className='empty-bookmark-message'>You dont have any movies bookmarked.</p> | ||
)} | ||
<Grid gutter={20}> | ||
{bookmarkedMovies.map(movie => ( | ||
<Grid.Col className='grid-item' span={{ base: 6, md: 3, lg: 2.4 }} key={movie.title}> | ||
<Link to={`/movie/${titleToSlug(movie.title)}`}> | ||
<MovieCard {...movie} /> | ||
</Link> | ||
</Grid.Col> | ||
))} | ||
</Grid> | ||
</StyleBookmarkedMovie> | ||
); | ||
} | ||
|
||
export default BookmarkedMovies; |
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 |
---|---|---|
|
@@ -26,5 +26,6 @@ export const StyledMovieCard = styled.div` | |
.bookmark-box { | ||
position: relative; | ||
left: 4px; | ||
color: white; | ||
} | ||
`; |
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
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
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
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,11 @@ | ||
function BookMarkedPage() { | ||
return <div>BookMarkedPage</div>; | ||
import BookmarkedMovies from "../components/BookmarkedMovies/BookmarkedMovies"; | ||
|
||
function BookmarkedPage() { | ||
return ( | ||
<div> | ||
<BookmarkedMovies /> | ||
</div> | ||
); | ||
} | ||
|
||
export default BookMarkedPage; | ||
export default BookmarkedPage; |
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