feat: new album view (initial implementation)

This commit is contained in:
Deluan
2020-02-07 11:45:56 -05:00
parent d37351610a
commit 81e1a7088f
7 changed files with 115 additions and 22 deletions
+8 -12
View File
@@ -26,18 +26,14 @@ const AddToQueueButton = ({ selectedIds }) => {
}
return (
<Button
color="secondary"
label={
<Tooltip
title={translate('resources.song.bulk.addToQueue')}
placement="right"
>
<AddToQueueIcon />
</Tooltip>
}
onClick={addToQueue}
/>
<Button color="secondary" onClick={addToQueue}>
<Tooltip
title={translate('resources.song.bulk.addToQueue')}
placement="right"
>
<AddToQueueIcon />
</Tooltip>
</Button>
)
}
-34
View File
@@ -1,34 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
import { IconButton } from '@material-ui/core'
import { useDispatch } from 'react-redux'
import { setTrack } from '../player'
const defaultIcon = <PlayArrowIcon fontSize="small" />
const PlayButton = ({
record,
icon = defaultIcon,
action = setTrack,
...rest
}) => {
const dispatch = useDispatch()
return (
<IconButton
onClick={() => dispatch(action(record))}
{...rest}
size={'small'}
>
{icon}
</IconButton>
)
}
PlayButton.propTypes = {
record: PropTypes.any,
icon: PropTypes.element,
action: PropTypes.func
}
export default PlayButton
+1 -1
View File
@@ -16,7 +16,7 @@ import {
import { useMediaQuery } from '@material-ui/core'
import { BitrateField, DurationField, Pagination, Title } from '../common'
import AddToQueueButton from './AddToQueueButton'
import PlayButton from './PlayButton'
import { PlayButton } from '../common'
import { useDispatch } from 'react-redux'
import { setTrack, addTrack } from '../player'
import AddIcon from '@material-ui/icons/Add'