-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(favorites): add favorites shelf
- Loading branch information
1 parent
8da119b
commit 15ff11c
Showing
5 changed files
with
66 additions
and
14 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,32 @@ | ||
import React from 'react'; | ||
import type { PlaylistItem } from 'types/playlist'; | ||
|
||
import ShelfComponent from '../../components/Shelf/Shelf'; | ||
import { favoritesStore } from '../../stores/FavoritesStore'; | ||
|
||
type FavoritesShelfProps = { | ||
playlistId: string; | ||
onCardClick: (playlistItem: PlaylistItem) => void; | ||
onCardHover: (playlistItem: PlaylistItem) => void; | ||
featured?: boolean; | ||
}; | ||
|
||
const Shelf = ({ playlistId, onCardClick, onCardHover, featured = false }: FavoritesShelfProps): JSX.Element => { | ||
const favoritesPlaylist = favoritesStore.useState(s => s.favorites); | ||
const continueWatchingPlaylist = favoritesStore.useState(s => s.favorites); | ||
|
||
const playlist = playlistId === 'favorites' ? favoritesPlaylist : continueWatchingPlaylist; | ||
|
||
return ( | ||
<ShelfComponent | ||
loading={false} | ||
error={null} | ||
playlist={playlist} | ||
onCardClick={onCardClick} | ||
onCardHover={onCardHover} | ||
featured={featured} | ||
/> | ||
); | ||
}; | ||
|
||
export default Shelf; |
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