Revert: Fix theme not being applied to PlayerToolbar

It was causing issues with classes being removed from DOM
This commit is contained in:
Deluan
2021-03-30 22:21:24 -04:00
parent 1f2b5294c3
commit 16e495a80f
+2 -6
View File
@@ -4,9 +4,6 @@ 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'
import config from '../config' import config from '../config'
const Placeholder = () => const Placeholder = () =>
@@ -14,7 +11,6 @@ const Placeholder = () =>
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)
@@ -24,7 +20,7 @@ const Toolbar = ({ id }) => {
} }
return ( return (
<ThemeProvider theme={createMuiTheme(theme)}> <>
<GlobalHotKeys keyMap={keyMap} handlers={handlers} allowChanges /> <GlobalHotKeys keyMap={keyMap} handlers={handlers} allowChanges />
{config.enableFavourites && ( {config.enableFavourites && (
<LoveButton <LoveButton
@@ -33,7 +29,7 @@ const Toolbar = ({ id }) => {
disabled={loading || toggling} disabled={loading || toggling}
/> />
)} )}
</ThemeProvider> </>
) )
} }