Add option to shuffle playlist
This commit is contained in:
@@ -5,9 +5,10 @@ import {
|
||||
useTranslate,
|
||||
} from 'react-admin'
|
||||
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
|
||||
import ShuffleIcon from '@material-ui/icons/Shuffle'
|
||||
import React from 'react'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { playTracks } from '../audioplayer'
|
||||
import { playTracks, shuffleTracks } from '../audioplayer'
|
||||
|
||||
const PlaylistActions = ({
|
||||
className,
|
||||
@@ -30,6 +31,14 @@ const PlaylistActions = ({
|
||||
>
|
||||
<PlayArrowIcon />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
dispatch(shuffleTracks(data, ids))
|
||||
}}
|
||||
label={translate('resources.album.actions.shuffle')}
|
||||
>
|
||||
<ShuffleIcon />
|
||||
</Button>
|
||||
</TopToolbar>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user