quintodrome/ui/src/layout/Layout.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
802 B
JavaScript
Raw Normal View History

import React from 'react'
import { useSelector } from 'react-redux'
import { Layout } from 'react-admin'
import { makeStyles } from '@material-ui/core/styles'
import Menu from './Menu'
2020-02-05 19:08:04 -09:00
import AppBar from './AppBar'
import Notification from './Notification'
2020-03-31 13:02:22 -08:00
import themes from '../themes'
const useStyles = makeStyles({
root: { paddingBottom: (props) => (props.addPadding ? '80px' : 0) },
})
export default (props) => {
2020-03-31 13:02:22 -08:00
const theme = useSelector((state) => themes[state.theme] || themes.DarkTheme)
const queue = useSelector((state) => state.queue)
const classes = useStyles({ addPadding: queue.queue.length > 0 })
return (
2020-03-31 13:02:22 -08:00
<Layout
{...props}
className={classes.root}
menu={Menu}
appBar={AppBar}
theme={theme}
notification={Notification}
2020-03-31 13:02:22 -08:00
/>
)
}