|
| 1 | +import { useNavigate } from "@remix-run/react"; |
| 2 | +import { Modal } from "components/modal"; |
| 3 | +import { Video, videos } from "components/video"; |
| 4 | +import { useHubspotDonCalculatorForm } from "hooks/use-hubspot-don-calculator-form"; |
| 5 | +import { useState } from "react"; |
| 6 | + |
| 7 | +export function Top({ classes = "" }) { |
| 8 | + const [open, setOpen] = useState(false); |
| 9 | + const navigate = useNavigate(); |
| 10 | + const { state } = useHubspotDonCalculatorForm(); |
| 11 | + return ( |
| 12 | + <section |
| 13 | + className={`${classes} grid grid-cols-1 lg:grid-cols-2 gap-12 p-4 @container`} |
| 14 | + > |
| 15 | + <div className="h-fit self-center relative"> |
| 16 | + <Tooltip className="max-xl:hidden absolute -right-24 z-10" /> |
| 17 | + <Video |
| 18 | + vid={videos.donation_calculator} |
| 19 | + classes="relative shadow-xl shadow-black/10 rounded-lg" |
| 20 | + /> |
| 21 | + </div> |
| 22 | + <div> |
| 23 | + <h1 className="text-4.5xl leading-snug max-lg:text-center text-right"> |
| 24 | + <div className="relative w-fit max-lg:mx-auto lg:ml-auto text-nowrap"> |
| 25 | + You're Losing Donations{" "} |
| 26 | + <span className="absolute bottom-2 left-0 w-full h-4 bg-blue-l3 -z-10"></span> |
| 27 | + </div> |
| 28 | + </h1> |
| 29 | + <p className="mb-4 text-gray-d4 text-lg max-lg:text-center text-right mt-4"> |
| 30 | + Thousands of dollars are slipping through the cracks every year – lost |
| 31 | + to fees, idle cash, and outdated donation methods. |
| 32 | + </p> |
| 33 | + <p className="mb-4 text-gray-d4 font-semibold text-lg max-lg:text-center text-right mt-4"> |
| 34 | + The longer you wait, the more you miss. |
| 35 | + </p> |
| 36 | + <div className="mb-4 text-gray-d4 text-lg max-lg:text-center text-right"> |
| 37 | + See see exactly how much revenue is being left on the table – and how |
| 38 | + quickly you could turn that around. |
| 39 | + </div> |
| 40 | + <button |
| 41 | + onClick={() => { |
| 42 | + if (state !== "loaded") { |
| 43 | + return navigate("/donation-calculator"); |
| 44 | + } |
| 45 | + setOpen(true); |
| 46 | + }} |
| 47 | + type="button" |
| 48 | + className="mt-8 shadow-xl capitalize shadow-black/10 btn btn-blue text-center lg:text-right justify-self-center lg:justify-self-end rounded-lg py-4 px-8 w-full md:w-auto" |
| 49 | + > |
| 50 | + See what you're losing |
| 51 | + </button> |
| 52 | + {open && ( |
| 53 | + <Modal |
| 54 | + classes="fixed-center z-10 grid text-gray-d4 bg-white w-[calc(100%-2.5rem)] max-w-4xl rounded-lg" |
| 55 | + open={open} |
| 56 | + onClose={() => setOpen(false)} |
| 57 | + > |
| 58 | + <div |
| 59 | + className="hs-form-frame" |
| 60 | + data-region="eu1" |
| 61 | + data-form-id="17bb2a2b-322c-4a8c-b8d6-50bb1a59881c" |
| 62 | + data-portal-id="24900163" |
| 63 | + /> |
| 64 | + </Modal> |
| 65 | + )} |
| 66 | + |
| 67 | + <p className="max-lg:text-center text-right text-sm text-gray mt-2"> |
| 68 | + "It takes less than a minute — find out how much you're leaving on the |
| 69 | + table." |
| 70 | + </p> |
| 71 | + </div> |
| 72 | + </section> |
| 73 | + ); |
| 74 | +} |
| 75 | + |
| 76 | +function Tooltip({ className = "" }) { |
| 77 | + return ( |
| 78 | + <span className={`text-gray-d4 ${className}`}> |
| 79 | + <svg |
| 80 | + xmlns="http://www.w3.org/2000/svg" |
| 81 | + width="99" |
| 82 | + height="50.6" |
| 83 | + viewBox="0 0 90.2 49.5" |
| 84 | + fill="none" |
| 85 | + className="rotate-320" |
| 86 | + > |
| 87 | + <path |
| 88 | + d="M86.5184 47.9261C86.9386 48.7464 87.891 49.0896 88.7113 48.6694C89.5316 48.2492 89.8748 47.2968 89.4546 46.4765L86.5184 47.9261ZM0.750315 12.1702C0.292122 12.8603 0.480187 13.7913 1.17037 14.2495L12.4175 21.7161C13.1077 22.1743 14.0387 21.9863 14.4969 21.2961C14.955 20.6059 14.767 19.675 14.0768 19.2168L4.07932 12.5797L10.7164 2.58225C11.1746 1.89207 10.9865 0.961128 10.2963 0.502936C9.60613 0.0447435 8.67518 0.232808 8.21699 0.92299L0.750315 12.1702ZM89.4546 46.4765C82.5494 32.4322 74.5 21.0234 61.0685 14.6649C47.6713 8.3195 29.2413 7.1537 1.87328 12.6825L2.46732 15.6231C28.8433 10.0943 46.2017 11.7514 58.6565 17.6475C71.0773 23.5315 78.7006 33.7177 86.5184 47.9261L89.4546 46.4765Z" |
| 89 | + fill="#183244" |
| 90 | + /> |
| 91 | + </svg> |
| 92 | + <p className="text-gray-d4 -top-6 left-8 relative -rotate-[12deg] font-gochi text-nowrap"> |
| 93 | + Watch how it works! |
| 94 | + </p> |
| 95 | + </span> |
| 96 | + ); |
| 97 | +} |
0 commit comments