Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

replaced some headlessui components to shadcn components

doppedheart4363fdfefd8e
diff --git a/app/(static)/deck/components/DropdownProto.tsx b/app/(static)/deck/components/DropdownProto.tsx
index 7c43c213..7634cdca 100644
--- a/app/(static)/deck/components/DropdownProto.tsx
+++ b/app/(static)/deck/components/DropdownProto.tsx
@@ -1,6 +1,8 @@
-import { Menu, Transition } from "@headlessui/react";
+import { Button } from "@/components/ui/button";
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
-import { Fragment, Dispatch, SetStateAction } from "react";
+import { Dispatch, SetStateAction, useState } from "react";
+import { PopoverContent } from "@radix-ui/react-popover";
+import { PopoverTrigger, Popover } from "@/components/ui/popover";
function classNames(...classes: string[]) {
return classes.filter(Boolean).join(" ");
@@ -17,58 +19,62 @@ export default function DropDown({
option,
setOption,
}: DropDownProps) {
- return (
- <Menu as="div" className="relative block text-left w-full">
- <div>
- <Menu.Button className="inline-flex w-full justify-between items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-gray-400 font-light shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue">
- {option}
- <ChevronDownIcon
- className="-mr-1 ml-2 h-5 w-5 ui-open:hidden"
- aria-hidden="true"
- />
- <ChevronUpIcon
- className="-mr-1 ml-2 h-5 w-5 hidden ui-open:block"
- aria-hidden="true"
- />
- </Menu.Button>
- </div>
+ const [menuOpen, setMenuOpen] = useState<boolean>(false);
+ const [isFirstClick, setIsFirstClick] = useState<boolean>(false);
+
+ const handleMenuStateChange = (open: boolean) => {
+ if (isFirstClick) {
+ setMenuOpen(true); // Keep the dropdown open on the first click
+ return;
+ }
+
+ // If the menu is closed, reset the isFirstClick state
+ if (!open) {
+ setIsFirstClick(false);
+ setMenuOpen(false); // Ensure the dropdown is closed
+ } else {
+ setMenuOpen(true); // Open the dropdown
+ }
+ };
- <Transition
- as={Fragment}
- enter="transition ease-out duration-100"
- enterFrom="transform opacity-0 scale-95"
- enterTo="transform opacity-100 scale-100"
- leave="transition ease-in duration-75"
- leaveFrom="transform opacity-100 scale-100"
- leaveTo="transform opacity-0 scale-95"
- >
- <Menu.Items
- className="absolute left-0 z-10 mt-2 w-full origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
- key={option}
+ return (
+ <Popover open={menuOpen} onOpenChange={handleMenuStateChange}>
+ <PopoverTrigger asChild>
+ <Button
+ variant="outline"
+ className="h-8 bg-transparent w-full flex justify-between px-4 py-6"
>
- <div className="">
- {options.map((optionItem) => (
- <Menu.Item key={optionItem}>
- {({ active }) => (
- <button
- onClick={() => setOption(optionItem)}
- className={classNames(
- active ? "bg-gray-100 text-gray-900" : "text-gray-700",
- option === optionItem ? "bg-gray-200" : "",
- "px-4 py-2 text-sm w-full text-left flex items-center space-x-2 justify-between",
- )}
- >
- <span>{optionItem}</span>
- {option === optionItem ? (
- <CheckIcon className="w-4 h-4 text-bold" />
- ) : null}
- </button>
- )}
- </Menu.Item>
- ))}
+ <div>
+ {option}
</div>
- </Menu.Items>
- </Transition>
- </Menu>
- );
-}
+ {menuOpen ? <ChevronUpIcon
+ className="-mr-1 ml-2 h-5 w-5"
+ aria-hidden="true"
+ /> : <ChevronDownIcon
+ className="-mr-1 ml-2 h-5 w-5"
+ aria-hidden="true"
+ />}
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="w-[--radix-popover-trigger-width] max-h-[--radix-popover-content-available-height] z-10 bg-white shadow-lg ring-1 ring-black ring-opacity-5">
+ {options.map((optionItem) => (
+ <button
+ onClick={() => {
+ setOption(optionItem)
+ setMenuOpen(false)
+ }}
+ className={classNames(
+ option === optionItem ? "bg-gray-200" : "",
+ "px-4 py-2 text-sm w-full text-left flex items-center space-x-2 justify-between",
+ )}
+ >
+ <span>{optionItem}</span>
+ {option === optionItem ? (
+ <CheckIcon className="w-4 h-4 text-bold" />
+ ) : null}
+ </button>
+ ))}
+ </PopoverContent>
+ </Popover>
+ )
+}
\ No newline at end of file
diff --git a/app/(static)/investors/[slug]/page.tsx b/app/(static)/investors/[slug]/page.tsx
index 26ca6732..bf9e23de 100644
--- a/app/(static)/investors/[slug]/page.tsx
+++ b/app/(static)/investors/[slug]/page.tsx
@@ -1,29 +1,9 @@
import Head from "next/head";
import Link from "next/link";
import { notFound } from "next/navigation";
-
-import { Disclosure } from "@headlessui/react";
-import { CheckIcon } from "lucide-react";
-import { XIcon } from "lucide-react";
-import {
- RefreshCw as ArrowPathIcon,
- GitPullRequestArrow as CloudArrowUpIcon,
- Settings as Cog6ToothIcon,
- Fingerprint as FingerPrintIcon,
- Lock as LockClosedIcon,
- Minus as MinusSmallIcon,
- Plus as PlusSmallIcon,
- HardDrive as ServerIcon,
-} from "lucide-react";
-
import { Button } from "@/components/ui/button";
-import Footer from "@/components/web/footer";
-import { LogoCloud } from "@/components/web/landing-page/logo-cloud";
-import Navbar from "@/components/web/navbar";
import { getInvestor } from "@/lib/content/investor";
-import { cn } from "@/lib/utils";
-import { classNames } from "@/lib/utils";
export default async function InvestorPage({
params,
@@ -274,7 +254,7 @@ export default async function InvestorPage({
x={86}
/>
</svg>
- <blockquote className="text-balance text-xl font-medium leading-8 text-black text-gray-800 sm:text-2xl sm:leading-9">
+ <blockquote className="text-balance text-xl font-medium leading-8 text-gray-800 sm:text-2xl sm:leading-9">
<p>
Papermark solved a big pain point for me. DocSend
monopoly will end soon!
diff --git a/components/web/faq.tsx b/components/web/faq.tsx
index 20d91083..c21bddad 100644
--- a/components/web/faq.tsx
+++ b/components/web/faq.tsx
@@ -1,6 +1,10 @@
"use client";
-
-import { Disclosure } from "@headlessui/react";
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@/components/ui/accordion"
import { Minus as MinusSmallIcon, Plus as PlusSmallIcon } from "lucide-react";
const faqs = [
@@ -44,38 +48,41 @@ const faqs = [
export default function Faq() {
return (
<div className="">
- <dl className="mt-10 space-y-6 divide-y divide-gray-800/10 ">
- {faqs.map((faq) => (
- <Disclosure as="div" key={faq.question} className="pt-6">
- {({ open }) => (
- <>
- <dt>
- <Disclosure.Button className="flex w-full items-start justify-between text-left text-gray-800">
- <span className="text-balance font-medium leading-7">
- {faq.question}
- </span>
- <span className="ml-6 flex h-7 items-center">
- {open ? (
- <MinusSmallIcon
- className="h-6 w-6"
- aria-hidden="true"
- />
- ) : (
- <PlusSmallIcon className="h-6 w-6" aria-hidden="true" />
- )}
- </span>
- </Disclosure.Button>
- </dt>
- <Disclosure.Panel as="dd" className="mt-2 pr-12">
- <p className="text-balance leading-7 text-gray-500">
- {faq.answer}
- </p>
- </Disclosure.Panel>
- </>
- )}
- </Disclosure>
- ))}
- </dl>
+ <Accordion type="single" collapsible className="space-y-4">
+ {faqs.map((faq) => (
+ <AccordionItem key={faq.question} value={faq.question} >
+ <AccordionTrigger className="flex w-full items-start justify-between text-left text-gray-800 hover:no-underline">
+ <span className="text-balance font-medium leading-7">
+ {faq.question}
+ </span>
+ </AccordionTrigger>
+ <AccordionContent className="mt-2 pr-12">
+ <p className="text-balance leading-7 text-gray-500">
+ {faq.answer}
+ </p>
+ </AccordionContent>
+ </AccordionItem>
+ ))}
+ </Accordion>
</div>
);
}
+
+// return (
+// <Disclosure as="div" >
+// {({ open }) => (
+// <>
+// <dt>
+// <Disclosure.Button >
+//
+
+// </Disclosure.Button>
+// </dt>
+// <Disclosure.Panel as="dd" >
+//
+// </Disclosure.Panel>
+// </>
+// )}
+// </Accordion>
+// )
+