aboutsummaryrefslogtreecommitdiff
path: root/src/demo/Window/WindowSurface.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-10-10 14:11:42 +0300
committerGitHub <noreply@github.com>2020-10-10 14:11:42 +0300
commit2f96d3e26f433a57af26ecf2ec34b9fec4183d71 (patch)
treea8c2b1daf5170923f9e7ccb46f098e30d51e8a08 /src/demo/Window/WindowSurface.tsx
parentc33c6a521325adafb250124d2814423b3a4187b5 (diff)
parent36c0a6b3e7ac72e4e787d5def6b0cc03eae7db6c (diff)
downloadreact-benzin-2f96d3e26f433a57af26ecf2ec34b9fec4183d71.tar.gz
Merge pull request #15 from eug-vs/refactor/orientation
Revise BENZIN orientation
Diffstat (limited to 'src/demo/Window/WindowSurface.tsx')
-rw-r--r--src/demo/Window/WindowSurface.tsx44
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;