-
Notifications
You must be signed in to change notification settings - Fork 733
/
Copy pathMaskSelectionDialog.tsx
51 lines (46 loc) · 1.53 KB
/
MaskSelectionDialog.tsx
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
45
46
47
48
49
50
51
import React from 'react';
import MaskSelectionHeader from './MaskSelectionHeader/MaskSelectionHeader';
import MaskThumbnail from './MaskThumbnail/MaskThumbnail';
import Drawer from '@material-ui/core/Drawer';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { maskConfig } from '../VideoProvider/useMaskSettings/useMaskSettings';
import useVideoContext from '../../hooks/useVideoContext/useVideoContext';
const useStyles = makeStyles((theme: Theme) => ({
drawer: {
display: 'flex',
width: theme.rightDrawerWidth,
height: `calc(100% - ${theme.footerHeight}px)`,
},
thumbnailContainer: {
display: 'flex',
flexWrap: 'wrap',
padding: '5px',
overflowY: 'auto',
},
}));
function MaskSelectionDialog() {
const classes = useStyles();
const { isMaskSelectionOpen, setIsMaskSelectionOpen } = useVideoContext();
const imageNames = maskConfig.imageNames;
const images = maskConfig.images;
return (
<Drawer
variant="persistent"
anchor="right"
open={isMaskSelectionOpen}
transitionDuration={0}
classes={{
paper: classes.drawer,
}}
>
<MaskSelectionHeader onClose={() => setIsMaskSelectionOpen(false)} />
<div className={classes.thumbnailContainer}>
<MaskThumbnail thumbnail={'none'} name={'None'} />
{images.map((image, index) => (
<MaskThumbnail thumbnail={'image'} name={imageNames[index]} index={index} imagePath={image} key={image} />
))}
</div>
</Drawer>
);
}
export default MaskSelectionDialog;