diff --git a/.commitlintrc.js b/.commitlintrc.js index 7228b8245..6931bd893 100644 --- a/.commitlintrc.js +++ b/.commitlintrc.js @@ -8,6 +8,7 @@ module.exports = { 'playlist', 'videodetail', 'search', + 'favorites', ], ], }, diff --git a/README.md b/README.md index 7e0b2e5ba..b9b721dcc 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ The allowed scopes are: - playlist - videodetail - search +- favorites ### Subject diff --git a/src/App.tsx b/src/App.tsx index 01cc1c0cd..1a93d5543 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,6 +9,7 @@ import QueryProvider from './providers/QueryProvider'; import './i18n/config'; import './styles/main.scss'; import { initializeWatchHistory } from './stores/WatchHistoryStore'; +import { initializeFavorites } from './stores/FavoritesStore'; interface State { error: Error | null; @@ -27,6 +28,8 @@ class App extends Component { if (config.options.enableContinueWatching) { initializeWatchHistory(); } + + initializeFavorites(); } render() { diff --git a/src/components/Video/Video.tsx b/src/components/Video/Video.tsx index 0c3a40c46..5c960a84e 100644 --- a/src/components/Video/Video.tsx +++ b/src/components/Video/Video.tsx @@ -16,6 +16,7 @@ import IconButton from '../IconButton/IconButton'; import { formatDuration } from '../../utils/formatting'; import styles from './Video.module.scss'; +import FavoriteBorder from '../../icons/FavoriteBorder'; type Poster = 'fading' | 'normal'; @@ -24,11 +25,13 @@ type Props = { play: boolean; startPlay: () => void; goBack: () => void; + isFavorited: boolean; + onFavoriteButtonClick: () => void; poster: Poster; relatedShelf?: JSX.Element; }; -const Video: React.FC = ({ item, play, startPlay, goBack, poster, relatedShelf }: Props) => { +const Video: React.FC = ({ item, play, startPlay, goBack, poster, relatedShelf, isFavorited, onFavoriteButtonClick }: Props) => { const [isPlaying, setIsPlaying] = useState(false); const [mouseActive, setMouseActive] = useState(false); const breakpoint: Breakpoint = useBreakpoint(); @@ -77,7 +80,12 @@ const Video: React.FC = ({ item, play, startPlay, goBack, poster, related onClick={() => null} fullWidth={breakpoint < Breakpoint.sm} /> -