aboutsummaryrefslogtreecommitdiff
path: root/pages/components/modal.js
blob: 0a9d349ec7097ed3b7dc0138e21d5195121d0331 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export default function Modal({ open, onClose, children }) {
  return (
    <div
      onClick={onClose}
      className={`fixed z-50 inset-0 flex justify-center items-center transition-colors ${
        open ? "visible bg-black bg-opacity-50" : "invisible"
      }`}
    >
      <div
        onClick={(e) => e.stopPropagation()}
        className={`shadow rounded-xl p-6 transition-all ${
          open ? "scale-125 opacity-100" : "scale-100 opacity-0"
        }`}
      >
        {children}
      </div>
    </div>
  );
}