Fixes play icon color in "Light" theme (#972)
* fix(ui/src/album): White play button on hover for all themes - #960 * fix(PlayButton) : White play button for light theme - #960 * fix(PlayButton) : White play button for light theme - #960 * bug(AlbumGridView.js) - Album play button defaults to white, can be overridden - #960 Signed-off-by: Shishir <shishir.srik@gmail.com> * bug(AlbumGridView.js) - Album play button defaults to white, can be overridden - #960 * Reverted package.json and package-lock.json - #960 Signed-off-by: Shishir <shishir.srik@gmail.com> * Missing lint script added - #960 Signed-off-by: Shishir <shishir.srik@gmail.com> * Removed color, added className and made record required in PlayButton.propTypes - #960
This commit is contained in:
parent
dbda8712f2
commit
c57fa7a8fc
|
@ -73,7 +73,7 @@ const useStyles = makeStyles(
|
|||
textDecoration: 'none',
|
||||
},
|
||||
albumContainer: {},
|
||||
albumPlayButton: {},
|
||||
albumPlayButton: { color: 'white' },
|
||||
}),
|
||||
{ name: 'NDAlbumGridView' }
|
||||
)
|
||||
|
@ -128,7 +128,6 @@ const AlbumGridTile = ({ showArtist, record, basePath }) => {
|
|||
subtitle={
|
||||
<PlayButton
|
||||
className={classes.albumPlayButton}
|
||||
color={'white'}
|
||||
record={record}
|
||||
size="small"
|
||||
/>
|
||||
|
|
|
@ -5,16 +5,8 @@ import { IconButton } from '@material-ui/core'
|
|||
import { useDispatch } from 'react-redux'
|
||||
import { useDataProvider } from 'react-admin'
|
||||
import { playTracks } from '../actions'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
icon: {
|
||||
color: (props) => props.color,
|
||||
},
|
||||
})
|
||||
|
||||
export const PlayButton = ({ record, color, size, ...rest }) => {
|
||||
const classes = useStyles({ color })
|
||||
export const PlayButton = ({ record, size, className }) => {
|
||||
let extractSongsData = function (response) {
|
||||
const data = response.data.reduce(
|
||||
(acc, cur) => ({ ...acc, [cur.id]: cur }),
|
||||
|
@ -46,8 +38,7 @@ export const PlayButton = ({ record, color, size, ...rest }) => {
|
|||
playAlbum(record)
|
||||
}}
|
||||
aria-label="play"
|
||||
className={classes.icon}
|
||||
{...rest}
|
||||
className={className}
|
||||
size={size}
|
||||
>
|
||||
<PlayArrowIcon fontSize={size} />
|
||||
|
@ -56,9 +47,9 @@ export const PlayButton = ({ record, color, size, ...rest }) => {
|
|||
}
|
||||
|
||||
PlayButton.propTypes = {
|
||||
record: PropTypes.object,
|
||||
color: PropTypes.string,
|
||||
record: PropTypes.object.isRequired,
|
||||
size: PropTypes.string,
|
||||
className: PropTypes.string,
|
||||
}
|
||||
|
||||
PlayButton.defaultProps = {
|
||||
|
|
Loading…
Reference in New Issue