diff --git a/apps/web/src/components/landing-sections/navbar.tsx b/apps/web/src/components/landing-sections/navbar.tsx index 580b943d..c216355b 100644 --- a/apps/web/src/components/landing-sections/navbar.tsx +++ b/apps/web/src/components/landing-sections/navbar.tsx @@ -1,5 +1,5 @@ "use client"; -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import PrimaryButton from "../ui/custom-button"; import { motion, useScroll, useMotionValueEvent } from "framer-motion"; import Image from "next/image"; @@ -15,6 +15,7 @@ const Navbar = () => { const isPricingPage = pathname === "/pricing"; const [showNavbar, setShowNavbar] = useState(isPricingPage ? true : false); const [isOpen, setIsOpen] = useState(false); + const [isMounted, setIsMounted] = useState(false); const { trackButtonClick, trackLinkClick } = useAnalytics(); const handleGetStartedClick = (location: "navbar" | "mobile_menu") => { @@ -30,6 +31,10 @@ const Navbar = () => { ); }; + useEffect(() => { + setIsMounted(true); + }, []); + React.useEffect(() => { const handleEscape = (e: KeyboardEvent) => { if (e.key === "Escape" && isOpen) { @@ -58,40 +63,47 @@ const Navbar = () => { { name: "FAQ", href: "/#faq" }, ]; + if (!isMounted) { + return null; + } + return ( -
+
-
-
+ +
background
- Opensox AI -
+ Opensox AI +
-
+
{links.map((link, index) => { const isActive = pathname === link.href; return ( @@ -99,7 +111,7 @@ const Navbar = () => { key={index} href={link.href} className={cn( - "cursor-pointer hover:text-white", + "cursor-pointer hover:text-white transition-colors whitespace-nowrap", isActive && "text-white" )} > @@ -108,24 +120,24 @@ const Navbar = () => { ); })}
-
+
handleContributeClick("navbar")} - className="hidden min-[1115px]:flex items-center gap-2 px-4 py-2.5 bg-github-bg hover:bg-github-hover transition-colors rounded-lg border border-github-border text-white" + className="hidden lg:flex items-center gap-1.5 xl:gap-2 px-3 xl:px-4 py-2 xl:py-2.5 bg-github-bg hover:bg-github-hover transition-colors rounded-lg border border-github-border text-white" > - - Contribute + + Contribute handleGetStartedClick("navbar")} > - - + + Get Started @@ -135,14 +147,14 @@ const Navbar = () => { initial={{ opacity: 0, y: -10 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.25 }} - className="absolute top-full mt-2 left-0 w-full bg-neutral-900/90 backdrop-blur-xl border border-white/10 min-[1115px]:hidden flex flex-col items-center py-5 space-y-4 z-50 rounded-3xl" + className="absolute top-full mt-2 left-0 w-full max-h-[80vh] overflow-y-auto bg-neutral-900/95 backdrop-blur-xl border border-white/10 lg:hidden flex flex-col items-center py-5 space-y-4 z-50 rounded-3xl shadow-xl" > {links.map((link, index) => ( setIsOpen(false)} - className="text-white hover:text-gray-300 text-lg" + className="text-white hover:text-gray-300 text-base transition-colors" > {link.name} @@ -155,7 +167,7 @@ const Navbar = () => { setIsOpen(false); handleContributeClick("mobile_menu"); }} - className="flex items-center gap-2 px-4 py-2 bg-github-bg hover:bg-github-hover rounded-lg border border-github-border text-white transition-colors" + className="flex items-center gap-2 px-4 py-2.5 bg-github-bg hover:bg-github-hover rounded-lg border border-github-border text-white transition-colors" > Contribute @@ -166,4 +178,4 @@ const Navbar = () => { ); }; -export default Navbar; +export default Navbar; \ No newline at end of file