From 0f7b0e3caa6e93306e3cf58cf906c048f39d7366 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Fri, 1 Oct 2021 00:52:26 -0700 Subject: [PATCH] Add toasts, change wording for play vs append --- src/components/card/Card.tsx | 6 +++--- src/components/library/AlbumView.tsx | 3 +++ src/components/library/ArtistView.tsx | 2 +- src/components/playlist/PlaylistView.tsx | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/card/Card.tsx b/src/components/card/Card.tsx index 60e3efa..53d3d9b 100644 --- a/src/components/card/Card.tsx +++ b/src/components/card/Card.tsx @@ -58,19 +58,19 @@ const Card = ({ if (playClick.type === 'playlist') { const res = await getPlaylist(playClick.id); dispatch(setPlayQueue({ entries: res.song })); - notifyToast('info', `Added ${res.song.length} song(s) to the queue`); + notifyToast('info', `Playing ${res.song.length} song(s)`); } if (playClick.type === 'album') { const res = await getAlbum(playClick.id); dispatch(setPlayQueue({ entries: res.song })); - notifyToast('info', `Added ${res.song.length} song(s) to the queue`); + notifyToast('info', `Playing ${res.song.length} song(s)`); } if (playClick.type === 'artist') { const songs = await getAllArtistSongs(playClick.id); dispatch(setPlayQueue({ entries: songs })); - notifyToast('info', `Added ${songs.length} song(s) to the queue`); + notifyToast('info', `Playing ${songs.length} song(s)`); } dispatch(setStatus('PLAYING')); diff --git a/src/components/library/AlbumView.tsx b/src/components/library/AlbumView.tsx index 62b5cf5..5344e39 100644 --- a/src/components/library/AlbumView.tsx +++ b/src/components/library/AlbumView.tsx @@ -26,6 +26,7 @@ import GenericPageHeader from '../layout/GenericPageHeader'; import { TagLink } from './styled'; import { setStatus } from '../../redux/playerSlice'; import { addModalPage } from '../../redux/miscSlice'; +import { notifyToast } from '../shared/toast'; interface AlbumParams { id: string; @@ -92,6 +93,7 @@ const AlbumView = ({ ...rest }: any) => { const handlePlay = () => { dispatch(setPlayQueue({ entries: data.song })); dispatch(setStatus('PLAYING')); + notifyToast('info', `Playing ${data.song.length} song(s)`); }; const handlePlayAppend = () => { @@ -99,6 +101,7 @@ const AlbumView = ({ ...rest }: any) => { if (playQueue.entry.length < 1) { dispatch(setStatus('PLAYING')); } + notifyToast('info', `Added ${data.song.length} song(s) to the queue`); }; const handleFavorite = async () => { diff --git a/src/components/library/ArtistView.tsx b/src/components/library/ArtistView.tsx index 5312e07..2c279c3 100644 --- a/src/components/library/ArtistView.tsx +++ b/src/components/library/ArtistView.tsx @@ -92,7 +92,7 @@ const ArtistView = ({ ...rest }: any) => { const handlePlay = async () => { const songs = await getAllArtistSongs(data.id); dispatch(setPlayQueue({ entries: songs })); - notifyToast('info', `Added ${songs.length} song(s) to the queue`); + notifyToast('info', `Playing ${songs.length} song(s)`); }; const handlePlayAppend = async () => { diff --git a/src/components/playlist/PlaylistView.tsx b/src/components/playlist/PlaylistView.tsx index e8839d6..d207a44 100644 --- a/src/components/playlist/PlaylistView.tsx +++ b/src/components/playlist/PlaylistView.tsx @@ -161,6 +161,7 @@ const PlaylistView = ({ ...rest }) => { const handlePlay = () => { dispatch(setPlayQueue({ entries: playlist.entry })); dispatch(setStatus('PLAYING')); + notifyToast('info', `Playing ${playlist.entry.length} song(s)`); }; const handlePlayAppend = () => { @@ -168,6 +169,7 @@ const PlaylistView = ({ ...rest }) => { if (playQueue.entry.length < 1) { dispatch(setStatus('PLAYING')); } + notifyToast('info', `Added ${playlist.entry.length} song(s) to the queue`); }; const handleSave = async (recovery: boolean) => {