mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-07 10:53:22 +03:00
Reorder action buttons
This commit is contained in:
parent
30e98843ed
commit
a25044bdf6
@ -25,40 +25,48 @@ const AlbumActions = ({
|
|||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const translate = useTranslate()
|
const translate = useTranslate()
|
||||||
|
|
||||||
|
const handlePlay = React.useCallback(() => {
|
||||||
|
dispatch(playTracks(data, ids))
|
||||||
|
}, [dispatch, data, ids])
|
||||||
|
|
||||||
|
const handlePlayLater = React.useCallback(() => {
|
||||||
|
dispatch(addTracks(data, ids))
|
||||||
|
}, [dispatch, data, ids])
|
||||||
|
|
||||||
|
const handleShuffle = React.useCallback(() => {
|
||||||
|
dispatch(shuffleTracks(data, ids))
|
||||||
|
}, [dispatch, data, ids])
|
||||||
|
|
||||||
|
const handleDownload = React.useCallback(() => {
|
||||||
|
subsonic.download(albumId)
|
||||||
|
}, [albumId])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
|
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={handlePlay}
|
||||||
dispatch(playTracks(data, ids))
|
|
||||||
}}
|
|
||||||
label={translate('resources.album.actions.playAll')}
|
label={translate('resources.album.actions.playAll')}
|
||||||
>
|
>
|
||||||
<PlayArrowIcon />
|
<PlayArrowIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={handleShuffle}
|
||||||
dispatch(shuffleTracks(data, ids))
|
|
||||||
}}
|
|
||||||
label={translate('resources.album.actions.shuffle')}
|
label={translate('resources.album.actions.shuffle')}
|
||||||
>
|
>
|
||||||
<ShuffleIcon />
|
<ShuffleIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={handlePlayLater}
|
||||||
subsonic.download(albumId)
|
|
||||||
}}
|
|
||||||
label={translate('resources.album.actions.download')}
|
|
||||||
>
|
|
||||||
<CloudDownloadOutlinedIcon />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
dispatch(addTracks(data, ids))
|
|
||||||
}}
|
|
||||||
label={translate('resources.album.actions.addToQueue')}
|
label={translate('resources.album.actions.addToQueue')}
|
||||||
>
|
>
|
||||||
<AddToQueueIcon />
|
<AddToQueueIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={handleDownload}
|
||||||
|
label={translate('resources.album.actions.download')}
|
||||||
|
>
|
||||||
|
<CloudDownloadOutlinedIcon />
|
||||||
|
</Button>
|
||||||
</TopToolbar>
|
</TopToolbar>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -76,18 +76,18 @@ const PlaylistActions = ({
|
|||||||
>
|
>
|
||||||
<ShuffleIcon />
|
<ShuffleIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
|
||||||
onClick={handleDownload}
|
|
||||||
label={translate('resources.album.actions.download')}
|
|
||||||
>
|
|
||||||
<CloudDownloadOutlinedIcon />
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
onClick={handlePlayLater}
|
onClick={handlePlayLater}
|
||||||
label={translate('resources.album.actions.addToQueue')}
|
label={translate('resources.album.actions.addToQueue')}
|
||||||
>
|
>
|
||||||
<AddToQueueIcon />
|
<AddToQueueIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={handleDownload}
|
||||||
|
label={translate('resources.album.actions.download')}
|
||||||
|
>
|
||||||
|
<CloudDownloadOutlinedIcon />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={handleExport}
|
onClick={handleExport}
|
||||||
label={translate('resources.playlist.actions.export')}
|
label={translate('resources.playlist.actions.export')}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user