Hide Love button on Artist Page when EnableFavourites=false. Fix #2245

This commit is contained in:
Deluan
2023-03-10 23:31:32 -05:00
parent b520d8827a
commit ec0eb2866b
3 changed files with 18 additions and 25 deletions
+6 -15
View File
@@ -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}
/>
</>
)
}