Files
bee-dashboard/src/layout/Dashboard.tsx
T
Vojtech Simetka 28bbdfb2f6 style: sidebar styling (#194)
* style: sidebar styling

* style: hover and selected colors

* chore: split the sidebar items into separate component

* style: pretty much finished except for status button

* feat: sidebar status button as a separate component

* chore: spacing definition

* style: size of the status text

* fix: hiden navigation on small height screens
2021-08-31 11:27:38 +02:00

53 lines
1.2 KiB
TypeScript

import { useContext, ReactElement } from 'react'
import ErrorBoundary from '../components/ErrorBoundary'
import AlertVersion from '../components/AlertVersion'
import { Container, CircularProgress } from '@material-ui/core'
import { createStyles, Theme, makeStyles } from '@material-ui/core/styles'
import SideBar from '../components/SideBar'
import { Context } from '../providers/Bee'
const useStyles = makeStyles((theme: Theme) =>
createStyles({
content: {
marginLeft: 300,
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing(3),
paddingBottom: '65px',
},
}),
)
interface Props {
children?: ReactElement
}
const Dashboard = (props: Props): ReactElement => {
const classes = useStyles()
const { isLoading } = useContext(Context)
return (
<div>
<SideBar />
<ErrorBoundary>
<main className={classes.content}>
<AlertVersion />
{isLoading ? (
<Container style={{ textAlign: 'center', padding: '50px' }}>
<CircularProgress />
</Container>
) : (
props.children
)}
</main>
</ErrorBoundary>
</div>
)
}
export default Dashboard