Fix layout

This commit is contained in:
dominik-zeglen 2019-10-23 17:10:46 +02:00
parent 7376c5e84d
commit ae7bad925c

View file

@ -48,15 +48,19 @@ const styles = (theme: Theme) =>
}, },
bottom: 0, bottom: 0,
gridColumn: 2, gridColumn: 2,
left: 210, height: 70,
position: "fixed", position: "sticky",
width: "calc(100% - 210px)",
zIndex: 10 zIndex: 10
}, },
appLoader: { appLoader: {
height: appLoaderHeight, height: appLoaderHeight,
marginBottom: theme.spacing.unit * 2,
zIndex: 1201 zIndex: 1201
}, },
appLoaderPlaceholder: {
height: appLoaderHeight,
marginBottom: theme.spacing.unit * 2
},
arrow: { arrow: {
marginLeft: theme.spacing.unit * 2, marginLeft: theme.spacing.unit * 2,
transition: theme.transitions.duration.standard + "ms" transition: theme.transitions.duration.standard + "ms"
@ -81,11 +85,7 @@ const styles = (theme: Theme) =>
header: { header: {
display: "flex", display: "flex",
height: 40, height: 40,
marginBottom: theme.spacing.unit * 3, marginBottom: theme.spacing.unit * 3
marginTop: theme.spacing.unit * 2
},
hide: {
opacity: 0
}, },
isMenuSmall: { isMenuSmall: {
"& path": { "& path": {
@ -258,7 +258,15 @@ const styles = (theme: Theme) =>
flex: 1, flex: 1,
flexGrow: 1, flexGrow: 1,
marginLeft: 0, marginLeft: 0,
paddingBottom: theme.spacing.unit * 10 paddingBottom: theme.spacing.unit,
[theme.breakpoints.up("sm")]: {
paddingBottom: theme.spacing.unit * 3
}
},
viewContainer: {
minHeight: `calc(100vh - ${theme.spacing.unit * 2 +
appLoaderHeight +
70}px)`
} }
}); });
@ -319,12 +327,6 @@ const AppLayout = withStyles(styles, {
{({ isProgress }) => ( {({ isProgress }) => (
<AppHeaderContext.Provider value={appHeaderAnchor}> <AppHeaderContext.Provider value={appHeaderAnchor}>
<AppActionContext.Provider value={appActionAnchor}> <AppActionContext.Provider value={appActionAnchor}>
<LinearProgress
className={classNames(classes.appLoader, {
[classes.hide]: !isProgress
})}
color="primary"
/>
<div className={classes.root}> <div className={classes.root}>
<div className={classes.sideBar}> <div className={classes.sideBar}>
<ResponsiveDrawer <ResponsiveDrawer
@ -373,6 +375,15 @@ const AppLayout = withStyles(styles, {
[classes.contentToggle]: isMenuSmall [classes.contentToggle]: isMenuSmall
})} })}
> >
{isProgress ? (
<LinearProgress
className={classes.appLoader}
color="primary"
/>
) : (
<div className={classes.appLoaderPlaceholder} />
)}
<div className={classes.viewContainer}>
<div> <div>
<Container> <Container>
<div className={classes.header}> <div className={classes.header}>
@ -403,7 +414,10 @@ const AppLayout = withStyles(styles, {
<Chip <Chip
avatar={ avatar={
user.avatar && ( user.avatar && (
<Avatar alt="user" src={user.avatar.url} /> <Avatar
alt="user"
src={user.avatar.url}
/>
) )
} }
className={classes.userChip} className={classes.userChip}
@ -439,7 +453,9 @@ const AppLayout = withStyles(styles, {
> >
<Paper> <Paper>
<ClickAwayListener <ClickAwayListener
onClickAway={() => setMenuState(false)} onClickAway={() =>
setMenuState(false)
}
mouseEvent="onClick" mouseEvent="onClick"
> >
<Menu> <Menu>
@ -473,6 +489,7 @@ const AppLayout = withStyles(styles, {
</Container> </Container>
</div> </div>
<main className={classes.view}>{children}</main> <main className={classes.view}>{children}</main>
</div>
<div className={classes.appAction} ref={appActionAnchor} /> <div className={classes.appAction} ref={appActionAnchor} />
</div> </div>
</div> </div>