mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-13 22:02:15 +03:00
Fix theme not being applied to PlayerToolbar
This commit is contained in:
parent
ac37bf3631
commit
b42532dd7c
@ -4,11 +4,15 @@ import { useGetOne } from 'react-admin'
|
|||||||
import { GlobalHotKeys } from 'react-hotkeys'
|
import { GlobalHotKeys } from 'react-hotkeys'
|
||||||
import { LoveButton, useToggleLove } from '../common'
|
import { LoveButton, useToggleLove } from '../common'
|
||||||
import { keyMap } from '../hotkeys'
|
import { keyMap } from '../hotkeys'
|
||||||
|
import { ThemeProvider } from '@material-ui/styles'
|
||||||
|
import { createMuiTheme } from '@material-ui/core/styles'
|
||||||
|
import useCurrentTheme from '../themes/useCurrentTheme'
|
||||||
|
|
||||||
const Placeholder = () => <LoveButton disabled={true} resource={'song'} />
|
const Placeholder = () => <LoveButton disabled={true} resource={'song'} />
|
||||||
|
|
||||||
const Toolbar = ({ id }) => {
|
const Toolbar = ({ id }) => {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
|
const theme = useCurrentTheme()
|
||||||
const resource = location.pathname.startsWith('/song') ? 'song' : 'albumSong'
|
const resource = location.pathname.startsWith('/song') ? 'song' : 'albumSong'
|
||||||
const { data, loading } = useGetOne(resource, id)
|
const { data, loading } = useGetOne(resource, id)
|
||||||
const [toggleLove, toggling] = useToggleLove(resource, data)
|
const [toggleLove, toggling] = useToggleLove(resource, data)
|
||||||
@ -18,14 +22,14 @@ const Toolbar = ({ id }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<ThemeProvider theme={createMuiTheme(theme)}>
|
||||||
<GlobalHotKeys keyMap={keyMap} handlers={handlers} allowChanges />
|
<GlobalHotKeys keyMap={keyMap} handlers={handlers} allowChanges />
|
||||||
<LoveButton
|
<LoveButton
|
||||||
record={data}
|
record={data}
|
||||||
resource={resource}
|
resource={resource}
|
||||||
disabled={loading || toggling}
|
disabled={loading || toggling}
|
||||||
/>
|
/>
|
||||||
</>
|
</ThemeProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user