feat: custom SimpleList, to allow onClick handle

This commit is contained in:
Deluan
2020-02-07 15:35:05 -05:00
parent f0e7f3ef25
commit a50735a94c
5 changed files with 171 additions and 10 deletions
+3 -4
View File
@@ -10,13 +10,12 @@ import {
Show,
SimpleShowLayout,
TextField,
TextInput,
SimpleList
TextInput
} from 'react-admin'
import { useMediaQuery } from '@material-ui/core'
import { BitrateField, DurationField, Pagination, Title } from '../common'
import AddToQueueButton from './AddToQueueButton'
import { PlayButton } from '../common'
import { PlayButton, SimpleList } from '../common'
import { useDispatch } from 'react-redux'
import { setTrack, addTrack } from '../player'
import AddIcon from '@material-ui/icons/Add'
@@ -82,7 +81,7 @@ const SongList = (props) => {
tertiaryText={(record) => (
<DurationField record={record} source={'duration'} />
)}
linkType={false}
linkType={(id, basePath, record) => dispatch(setTrack(record))}
/>
) : (
<Datagrid