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:
@@ -73,7 +73,7 @@ const useStyles = makeStyles(
|
|||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
},
|
},
|
||||||
albumContainer: {},
|
albumContainer: {},
|
||||||
albumPlayButton: {},
|
albumPlayButton: { color: 'white' },
|
||||||
}),
|
}),
|
||||||
{ name: 'NDAlbumGridView' }
|
{ name: 'NDAlbumGridView' }
|
||||||
)
|
)
|
||||||
@@ -128,7 +128,6 @@ const AlbumGridTile = ({ showArtist, record, basePath }) => {
|
|||||||
subtitle={
|
subtitle={
|
||||||
<PlayButton
|
<PlayButton
|
||||||
className={classes.albumPlayButton}
|
className={classes.albumPlayButton}
|
||||||
color={'white'}
|
|
||||||
record={record}
|
record={record}
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -5,16 +5,8 @@ import { IconButton } from '@material-ui/core'
|
|||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch } from 'react-redux'
|
||||||
import { useDataProvider } from 'react-admin'
|
import { useDataProvider } from 'react-admin'
|
||||||
import { playTracks } from '../actions'
|
import { playTracks } from '../actions'
|
||||||
import { makeStyles } from '@material-ui/core/styles'
|
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
export const PlayButton = ({ record, size, className }) => {
|
||||||
icon: {
|
|
||||||
color: (props) => props.color,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const PlayButton = ({ record, color, size, ...rest }) => {
|
|
||||||
const classes = useStyles({ color })
|
|
||||||
let extractSongsData = function (response) {
|
let extractSongsData = function (response) {
|
||||||
const data = response.data.reduce(
|
const data = response.data.reduce(
|
||||||
(acc, cur) => ({ ...acc, [cur.id]: cur }),
|
(acc, cur) => ({ ...acc, [cur.id]: cur }),
|
||||||
@@ -46,8 +38,7 @@ export const PlayButton = ({ record, color, size, ...rest }) => {
|
|||||||
playAlbum(record)
|
playAlbum(record)
|
||||||
}}
|
}}
|
||||||
aria-label="play"
|
aria-label="play"
|
||||||
className={classes.icon}
|
className={className}
|
||||||
{...rest}
|
|
||||||
size={size}
|
size={size}
|
||||||
>
|
>
|
||||||
<PlayArrowIcon fontSize={size} />
|
<PlayArrowIcon fontSize={size} />
|
||||||
@@ -56,9 +47,9 @@ export const PlayButton = ({ record, color, size, ...rest }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PlayButton.propTypes = {
|
PlayButton.propTypes = {
|
||||||
record: PropTypes.object,
|
record: PropTypes.object.isRequired,
|
||||||
color: PropTypes.string,
|
|
||||||
size: PropTypes.string,
|
size: PropTypes.string,
|
||||||
|
className: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayButton.defaultProps = {
|
PlayButton.defaultProps = {
|
||||||
|
|||||||
Reference in New Issue
Block a user