diff --git a/components/navbar/desktop-navbar.tsx b/components/navbar/desktop-navbar.tsx new file mode 100644 index 0000000..9e46bee --- /dev/null +++ b/components/navbar/desktop-navbar.tsx @@ -0,0 +1,79 @@ +"use client"; +import { Logo } from "../Logo"; + +import { NavBarItem } from "./navbar-item"; +import { + useMotionValueEvent, + useScroll, + motion, + AnimatePresence, +} from "framer-motion"; +import { cn } from "@/lib/utils"; +import { useState } from "react"; + +import { ModeToggle } from "../mode-toggle"; + +type Props = { + navItems: { + link: string; + title: string; + target?: "_blank"; + }[]; +}; + +export const DesktopNavbar = ({ navItems }: Props) => { + const { scrollY } = useScroll(); + + const [showBackground, setShowBackground] = useState(false); + + useMotionValueEvent(scrollY, "change", (value) => { + if (value > 100) { + setShowBackground(true); + } else { + setShowBackground(false); + } + }); + return ( +
+ + {showBackground && ( + + )} + +
+ +
+ {navItems.map((item) => ( + + {item.title} + + ))} +
+
+
+ + {/* Login/Signup buttons - uncomment to enable authentication */} + {/* + */} +
+
+ ); +};