-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModal.tsx
33 lines (29 loc) · 775 Bytes
/
Modal.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
import React, { ReactNode } from "react";
interface Props {
isOpen: boolean;
onClose: () => void;
children: ReactNode;
}
function Modal(props: Props) {
return (
<div
onClick={props.onClose}
className={`fixed inset-0 z-50 overflow-y-auto ${
props.isOpen ? "flex" : "hidden"
}`}
>
<div className="fixed inset-0 transition-opacity">
<div className="absolute inset-0 bg-neutral-900 opacity-75"></div>
</div>
<div
className="relative flex-1 flex items-center justify-center min-w-0 w-full h-full rounded-lg shadow-lg overflow-y-auto"
tabIndex={-1}
>
{/* Insert Modal Content Here */}
{props.chilren}
{/* */}
</div>
</div>
);
}
export default Modal;