-
-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathChangesModal.jsx
More file actions
86 lines (83 loc) · 2.07 KB
/
ChangesModal.jsx
File metadata and controls
86 lines (83 loc) · 2.07 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
76
77
78
79
80
81
82
83
84
85
86
import { Modal, Box, Typography, Grid, Button } from '@mui/material';
import { Link } from 'react-router-dom';
import WarningAmberRoundedIcon from '@mui/icons-material/WarningAmberRounded';
const style = {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 400,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 4,
};
export default function ChangesModal({
open,
onClose,
handleClose,
destination,
}) {
return (
<Modal
open={open}
onClose={onClose}
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
>
<Box sx={style}>
<Typography
sx={{ textAlign: 'center' }}
id="modal-modal-title"
variant="h4"
component="h3"
>
<WarningAmberRoundedIcon fontSize="large" color="error" />
</Typography>
<Typography
sx={{ textAlign: 'center' }}
id="modal-modal-title"
variant="h4"
component="h4"
>
Wait! You made some changes.
</Typography>
<Typography
id="modal-modal-description"
sx={{ mt: 2, textAlign: 'center' }}
>
Are you sure you want to exit without saving?
</Typography>
<Grid
direction="column"
spacing={3}
container
alignContent="center"
sx={{ my: 3 }}
>
<Grid item xs="auto">
<Button
component={Link}
to={destination}
variant="secondary"
style={{ width: '150px', cursor: 'pointer' }}
>
Yes
</Button>
</Grid>
<Grid item xs="auto">
<Button
type="submit"
form="project-form"
style={{ width: '150px', cursor: 'pointer' }}
variant="contained"
onClick={handleClose}
>
No
</Button>
</Grid>
</Grid>
</Box>
</Modal>
);
}