summaryrefslogtreecommitdiff
path: root/src/components/elements/BottomPopup.js
blob: deb1b895f348759790bcaa1a968b275784a1b2a4 (plain)
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
import CloseIcon from "@/icons/close.svg";

const BottomPopup = ({ 
  active = false, 
  title, 
  children, 
  closePopup = () => {}
}) => {
  return (
    <>
      <div className={"menu-overlay " + (active ? 'block' : 'hidden')} onClick={closePopup} />
      <div className={`fixed w-full z-[60] py-6 px-4 bg-white rounded-t-3xl idt-transition ${active ? 'bottom-0' : 'bottom-[-100%]'}`}>
        <div className="flex justify-between items-center mb-5">
          <h2 className="text-xl font-semibold">{ title }</h2>
          <button onClick={closePopup}>
            <CloseIcon className="w-7" />
          </button>
        </div>
        { children }
      </div>
    </>
  );
};

export default BottomPopup;