2020-01-22 08:46:09 -09:00
|
|
|
import React from 'react'
|
2020-03-31 05:35:44 -08:00
|
|
|
import { useSelector } from 'react-redux'
|
2020-01-22 08:46:09 -09:00
|
|
|
import { Layout } from 'react-admin'
|
2020-03-31 10:52:54 -08:00
|
|
|
import { makeStyles } from '@material-ui/core/styles'
|
2020-01-22 08:46:09 -09:00
|
|
|
import Menu from './Menu'
|
2020-02-05 19:08:04 -09:00
|
|
|
import AppBar from './AppBar'
|
2020-03-31 05:35:44 -08:00
|
|
|
import { DarkTheme, LightTheme } from '../themes'
|
2020-01-22 08:46:09 -09:00
|
|
|
|
2020-03-31 10:52:54 -08:00
|
|
|
const useStyles = makeStyles({
|
|
|
|
|
root: { paddingBottom: '80px' }
|
|
|
|
|
})
|
|
|
|
|
|
2020-03-31 05:35:44 -08:00
|
|
|
export default (props) => {
|
2020-03-31 10:52:54 -08:00
|
|
|
const classes = useStyles()
|
2020-03-31 05:35:44 -08:00
|
|
|
const theme = useSelector((state) =>
|
|
|
|
|
state.theme === 'dark' ? DarkTheme : LightTheme
|
|
|
|
|
)
|
|
|
|
|
|
2020-03-31 10:52:54 -08:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Layout
|
|
|
|
|
{...props}
|
|
|
|
|
className={classes.root}
|
|
|
|
|
menu={Menu}
|
|
|
|
|
appBar={AppBar}
|
|
|
|
|
theme={theme}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
)
|
2020-03-31 05:35:44 -08:00
|
|
|
}
|