aboutsummaryrefslogtreecommitdiff
path: root/src/components/Window/WindowSurface/WindowSurface.js
blob: 26fea01992e875fe9515d369c87c072595f26817 (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
import React from 'react';

import { Paper, makeStyles } from '@material-ui/core';


const useStyles = makeStyles(theme => ({
  surface: {
    position: 'absolute',
    display: 'flex',
    flexDirection: 'column',
    background: theme.palette.background.elevation,
    overflowY: 'auto',
    scrollbarColor: `${theme.palette.primary.dark} ${theme.palette.primary.light}`,
  }
}));


const WindowSurface = ({ size, position, children }) => {
  const classes = useStyles();

  return (
    <Paper
      elevation={3}
      style={{...size, ...position}}
      className={classes.surface}
    >
      {children}
    </Paper>
  )
};


export default WindowSurface;