-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectClothDialog.js
More file actions
75 lines (69 loc) · 2.03 KB
/
SelectClothDialog.js
File metadata and controls
75 lines (69 loc) · 2.03 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from 'react';
import AppBar from "@material-ui/core/AppBar";
import Dialog from "@material-ui/core/Dialog";
import Gallery from "react-grid-gallery";
import Slide from "@material-ui/core/Slide";
import Toolbar from "@material-ui/core/Toolbar";
import CloseIcon from "@material-ui/icons/Close";
import IconButton from "@material-ui/core/IconButton";
import { makeStyles } from "@material-ui/core/styles";
import Typography from "@material-ui/core/Typography";
import ClothImages from "../../Constants/ClothImages"
const useStyles = makeStyles((theme) => ({
appBar: {
position: "relative",
},
title: {
marginLeft: theme.spacing(2),
flex: 1,
},
backdrop: {
zIndex: theme.zIndex.drawer + 1,
color: '#fff',
},
}));
const Transition = React.forwardRef(function Transition(props, ref) {
return <Slide direction="up" ref={ref} {...props} />;
});
function SelectClothDialog({open, setOpen, setSelectedProduct})
{
const classes = useStyles();
const handleClose = () => {
setOpen(false);
}
const onSelectImage = (index) => {
setSelectedProduct(ClothImages[index]);
handleClose();
};
return (<Dialog
fullScreen
open={open}
onClose={handleClose}
TransitionComponent={Transition}
>
<AppBar className={classes.appBar}>
<Toolbar>
<IconButton
edge="start"
color="inherit"
onClick={handleClose}
aria-label="close"
>
<CloseIcon />
</IconButton>
<Typography variant="h6" className={classes.title}>
Select a dress
</Typography>
</Toolbar>
</AppBar>
<div style={{padding: "5px"}}>
<Gallery
images={ClothImages}
onSelectImage={onSelectImage}
onClickThumbnail={onSelectImage}
enableLightbox={false}
/>
</div>
</Dialog>);
}
export default SelectClothDialog;