diff --git a/apps/web/src/components/faq/FaqSection.tsx b/apps/web/src/components/faq/FaqSection.tsx index 220f446..f46b393 100644 --- a/apps/web/src/components/faq/FaqSection.tsx +++ b/apps/web/src/components/faq/FaqSection.tsx @@ -9,7 +9,7 @@ import { faqs } from "./faqData"; export function FaqSection() { return ( -
+
{ const pathname = usePathname(); const isPricingPage = pathname === "/pricing"; const [showNavbar, setShowNavbar] = useState(isPricingPage ? true : false); + const [isOpen, setIsOpen] = useState(false); + + React.useEffect(() => { + const handleEscape = (e: KeyboardEvent) => { + if (e.key === "Escape" && isOpen) { + setIsOpen(false); + (document.activeElement as HTMLElement)?.blur(); + } + }; + + document.addEventListener("keydown", handleEscape); + return () => document.removeEventListener("keydown", handleEscape); + }, [isOpen]); useMotionValueEvent(scrollYProgress, "change", (latest) => { if (!isPricingPage) { @@ -27,6 +40,7 @@ const Navbar = () => { { name: "How it works", href: "/#HIW" }, { name: "Stats", href: "/#Stats" }, { name: "Contact", href: "/#Contact" }, + { name: "FAQ", href: "/#faq" }, ]; return ( @@ -41,6 +55,14 @@ const Navbar = () => { : "fixed rounded-3xl top-4 border w-[94%] md:w-[80%] mx-auto left-1/2 -translate-x-1/2" )} > +
{ ); })}
-
+
{
+ {isOpen && ( + + {links.map((link, index) => ( + setIsOpen(false)} + className="text-white hover:text-gray-300 text-lg" + > + {link.name} + + ))} + setIsOpen(false)} + className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors" + > + + Contribute + + setIsOpen(false)} + className="cursor-pointer z-30" + > + + + Get Started + + + + )} ); };