diff options
author | eug-vs <eug-vs@keemail.me> | 2020-10-10 13:39:08 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-10-10 13:39:08 +0300 |
commit | bfa9f7b9158faa3a453eaabf5be3c96b6c8a18b1 (patch) | |
tree | 1f8b2b987b24ecacb9b1fe62ce57d1f0ac6f6230 /src/demo/Window/WindowSurface.tsx | |
parent | c33c6a521325adafb250124d2814423b3a4187b5 (diff) | |
download | react-benzin-bfa9f7b9158faa3a453eaabf5be3c96b6c8a18b1.tar.gz |
refactor: remove demo components from lib
Diffstat (limited to 'src/demo/Window/WindowSurface.tsx')
-rw-r--r-- | src/demo/Window/WindowSurface.tsx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/demo/Window/WindowSurface.tsx b/src/demo/Window/WindowSurface.tsx new file mode 100644 index 0000000..1900901 --- /dev/null +++ b/src/demo/Window/WindowSurface.tsx @@ -0,0 +1,44 @@ +import React from 'react'; + +import { Paper, makeStyles } from '@material-ui/core'; + +import { SurfaceSize, SurfacePosition } from './types'; + + +interface PropTypes { + size: SurfaceSize; + position: SurfacePosition; +} + + +const useStyles = makeStyles(theme => ({ + surface: { + position: 'absolute', + display: 'flex', + flexDirection: 'column', + overflowY: 'auto', + scrollbarColor: `${theme.palette.secondary.dark} ${theme.palette.secondary.light}`, + + '& a.MuiTypography-root': { + color: theme.palette.primary.light, + }, + }, +})); + + +const WindowSurface: React.FC<PropTypes> = ({ size, position, children }) => { + const classes = useStyles(); + + return ( + <Paper + variant="outlined" + style={{ ...size, ...position }} + className={classes.surface} + > + {children} + </Paper> + ); +}; + + +export default WindowSurface; |