All files / src/components/Modals/RecieveUpdatesModal index.tsx

0% Statements 0/17
0% Branches 0/1
0% Functions 0/4
0% Lines 0/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                                                                                                                 
import React, { useEffect } from "react";
import Overlay from "../../Overlay/index.tsx";
import { CloseRounded } from "@mui/icons-material";
import CustomButton from "../../common/CustomButton/index.tsx";
import posthog from "posthog-js";
 
const RecieveUpdatesModal = ({ isOpen, close }) => {
  const handleYes = () => {
    posthog.capture("POST_LOGIN_SUBSCRIPTION_UPDATE_INTERACTED", {
      subscription_requested: true,
    });
    close();
  };
 
  const handleNo = () => {
    posthog.capture("POST_LOGIN_SUBSCRIPTION_UPDATE_INTERACTED", {
      subscription_requested: false,
    });
    close();
  };
 
  useEffect(() => {
    Iif (isOpen) {
      posthog.capture("POST_LOGIN_SUBSCRIPTION_UPDATE_SHOWN");
    }
  }, [isOpen]);
 
  return (
    <div className="z-50">
      <Overlay close={close} visible={isOpen}>
        <div className="relative bg-white py-6 px-4 rounded max-w-full w-[300px]">
          <div
            onClick={close}
            className="absolute top-0 right-0 m-2 cursor-pointer">
            <CloseRounded />
          </div>
          <p className="font-semibold text-sm">
            Would you like to receive updates about new features & releases in
            Playbooks?
          </p>
 
          <div className="flex items-center gap-2 mt-4">
            <CustomButton
              onClick={handleYes}
              className="!bg-violet-500 !text-white hover:!text-violet-500 hover:!bg-transparent">
              Yes Please!
            </CustomButton>
            <CustomButton onClick={handleNo}>No thanks</CustomButton>
          </div>
        </div>
      </Overlay>
    </div>
  );
};
 
export default RecieveUpdatesModal;