Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
remove banner if hidden
Marc Seitz63736120ee94
diff --git a/pages/index.tsx b/pages/index.tsxindex 377b95f8..938173e2 100644--- a/pages/index.tsx+++ b/pages/index.tsx@@ -8,8 +8,21 @@ import Testimonials from "@/components/web/testimonials";import Logos from "@/components/web/logos";import Head from "next/head";import Section3 from "@/components/web/section3";+import X from "@/components/shared/icons/x";+import { useEffect, useState } from "react";+import Cookies from "js-cookie";export default function Home() {+ const [showBanner, setShowBanner] = useState<boolean>(true);++ useEffect(() => {+ if (Cookies.get("hideBanner") !== "product-day-banner") {+ setShowBanner(true);+ } else {+ setShowBanner(false);+ }+ }, []);+return (<><Head>@@ -60,29 +73,44 @@ export default function Home() {</div><Footer />- <div className="fixed bottom-5 z-20 mx-5 flex flex-col space-y-4 rounded-lg border border-gray-400 bg-white p-5 shadow-lg sm:right-5 sm:mx-auto sm:max-w-sm">- <h3 className="text-lg font-semibold text-black">- Thank you, Papermark Community ✨- </h3>- <p className="text-sm text-gray-500">- With the support of the open-source community, we launched on Product- Hunt to <span className="font-bold">#1 of the day</span>.- </p>- <div className="flex justify-center">- <div className="">- <a- target="_blank"- href="https://www.producthunt.com/posts/papermark-3?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-papermark"+ { showBanner ? (+ <div className="fixed bottom-5 z-20 mx-5 flex flex-col space-y-4 rounded-lg border border-gray-400 bg-white p-5 shadow-lg sm:right-5 sm:mx-auto sm:max-w-sm">+ <div className="absolute top-2 right-2 text-gray-500">+ <button+ onClick={() => {+ setShowBanner(false);+ Cookies.set("hideBanner", "product-day-banner", {+ expires: 7,+ });+ }}>- <img- src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=411605&theme=light&period=daily"- alt="Papermark - The open-source DocSend alternative | Product Hunt"- className="w-[250px] h-[54px]"- />- </a>+ <X className="h-4 w-4" />+ </button>+ </div>+ <h3 className="text-lg font-semibold text-black">+ Thank you, Papermark Community ✨+ </h3>+ <p className="text-sm text-gray-500">+ With the support of the open-source community, we launched on Product+ Hunt to <span className="font-bold">#1 of the day</span>.+ </p>+ <div className="flex justify-center">+ <div className="">+ <a+ target="_blank"+ href="https://www.producthunt.com/posts/papermark-3?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-papermark"+ >+ <img+ src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=411605&theme=light&period=daily"+ alt="Papermark - The open-source DocSend alternative | Product Hunt"+ className="w-[250px] h-[54px]"+ />+ </a>+ </div></div></div>- </div>+ ) : null }+</>);}