forked from tdjsnelling/sqtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModal.js
More file actions
51 lines (49 loc) · 1.16 KB
/
Copy pathModal.js
File metadata and controls
51 lines (49 loc) · 1.16 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
import React from "react";
import { X } from "@styled-icons/boxicons-regular";
import Box from "./Box";
import Button from "./Button";
const Modal = ({ children, close }) => {
return (
<Box
position="fixed"
top={0}
bottom={0}
left={0}
right={0}
bg="rgba(0, 0, 0, 0.66)"
zIndex={10}
>
<Box
position="absolute"
top="100px"
left="50%"
bg="background"
border="1px solid"
borderColor="border"
borderRadius={2}
maxWidth="600px"
maxHeight="calc(100vh - 200px)"
width="100%"
_css={{ transform: "translateX(-50%)" }}
>
<Box
display="flex"
alignItems="center"
justifyContent="flex-end"
borderBottom="1px solid"
borderColor="border"
height="60px"
px={5}
>
<Button onClick={close} variant="noBackground" px={3} py={1}>
<X size={20} />
</Button>
</Box>
<Box maxHeight="calc(100vh - 200px - 60px)" overflow="auto" p={5}>
{children}
</Box>
</Box>
</Box>
);
};
export default Modal;