aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Window/WindowSurface.tsx
blob: a65e39899ee566078692d97bc154a3aef7ea6f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;