Add Genres as "Chips" in Album details and Song details
This commit is contained in:
@@ -5,6 +5,7 @@ import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder'
|
||||
import IconButton from '@material-ui/core/IconButton'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import { useToggleLove } from './useToggleLove'
|
||||
import { useRecordContext } from 'react-admin'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
love: {
|
||||
@@ -16,7 +17,6 @@ const useStyles = makeStyles({
|
||||
|
||||
export const LoveButton = ({
|
||||
resource,
|
||||
record,
|
||||
color,
|
||||
visible,
|
||||
size,
|
||||
@@ -25,6 +25,7 @@ export const LoveButton = ({
|
||||
disabled,
|
||||
...rest
|
||||
}) => {
|
||||
const record = useRecordContext(rest) || {}
|
||||
const classes = useStyles({ color, visible, loved: record.starred })
|
||||
const [toggleLove, loading] = useToggleLove(resource, record)
|
||||
|
||||
@@ -56,7 +57,7 @@ export const LoveButton = ({
|
||||
|
||||
LoveButton.propTypes = {
|
||||
resource: PropTypes.string.isRequired,
|
||||
record: PropTypes.object.isRequired,
|
||||
record: PropTypes.object,
|
||||
visible: PropTypes.bool,
|
||||
color: PropTypes.string,
|
||||
size: PropTypes.string,
|
||||
@@ -66,7 +67,6 @@ LoveButton.propTypes = {
|
||||
|
||||
LoveButton.defaultProps = {
|
||||
addLabel: true,
|
||||
record: {},
|
||||
visible: true,
|
||||
size: 'small',
|
||||
color: 'inherit',
|
||||
|
||||
Reference in New Issue
Block a user