Hide Love button on Artist Page when EnableFavourites=false. Fix #2245
This commit is contained in:
@@ -3,15 +3,8 @@ import { useGetOne } from 'react-admin'
|
||||
import { GlobalHotKeys } from 'react-hotkeys'
|
||||
import { LoveButton, useToggleLove } from '../common'
|
||||
import { keyMap } from '../hotkeys'
|
||||
import config from '../config'
|
||||
|
||||
const Placeholder = () => (
|
||||
<>
|
||||
{config.enableFavourites && (
|
||||
<LoveButton disabled={true} resource={'song'} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
const Placeholder = () => <LoveButton disabled={true} resource={'song'} />
|
||||
|
||||
const Toolbar = ({ id }) => {
|
||||
const { data, loading } = useGetOne('song', id)
|
||||
@@ -24,13 +17,11 @@ const Toolbar = ({ id }) => {
|
||||
return (
|
||||
<>
|
||||
<GlobalHotKeys keyMap={keyMap} handlers={handlers} allowChanges />
|
||||
{config.enableFavourites && (
|
||||
<LoveButton
|
||||
record={data}
|
||||
resource={'song'}
|
||||
disabled={loading || toggling}
|
||||
/>
|
||||
)}
|
||||
<LoveButton
|
||||
record={data}
|
||||
resource={'song'}
|
||||
disabled={loading || toggling}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user