Files
new-phone-who-dis/phone/src/ui/components/AppContent.tsx
T
Taso 79669c1710 styling(AppTitle & AppContent): Misc changes
- Fixes annoying AppContent whitespace on border
- Better styles AppTitle
2020-11-18 13:09:06 -05:00

49 lines
1.2 KiB
TypeScript

import React from "react";
import { Box, makeStyles, Backdrop, Paper } from "@material-ui/core";
import { AppContentTypes } from "../interface/InterfaceUI";
const useStyles = makeStyles(() => ({
wrapper: {
height: "70vh", // NOTE: Taso: Hacky change temp, this should be done automatically tbh. Will refactor at some point
overflow: "auto",
},
box: {
width: "100%",
height: "100%", // allow application to fill entireity of space
position: "relative",
overflow: "auto",
},
backdrop: {
position: "absolute",
zIndex: 1,
},
paper: {
width: "100%",
height: "100%", // allow application to fill entireity of space
},
}));
export const AppContent = ({
children,
style,
backdrop,
onClickBackdrop,
...props
}: AppContentTypes) => {
const classes = useStyles();
return (
<Paper className={classes.wrapper} square>
<Box flexGrow={1} className={classes.box} {...props}>
<Paper square elevation={0} className={classes.paper}>
<Backdrop
className={classes.backdrop}
open={backdrop || false}
onClick={onClickBackdrop}
></Backdrop>
{children}
</Paper>
</Box>
</Paper>
);
};