feat: simple theme selector. only works with hardcoded light and dark for now
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import React from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { Layout } from 'react-admin'
|
||||
import Menu from './Menu'
|
||||
import AppBar from './AppBar'
|
||||
import { DarkTheme, LightTheme } from '../themes'
|
||||
|
||||
export default (props) => <Layout {...props} menu={Menu} appBar={AppBar} />
|
||||
export default (props) => {
|
||||
const theme = useSelector((state) =>
|
||||
state.theme === 'dark' ? DarkTheme : LightTheme
|
||||
)
|
||||
|
||||
return <Layout {...props} menu={Menu} appBar={AppBar} theme={theme} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user