diff --git a/src/components/ui/NavbarCentered.tsx b/src/components/ui/NavbarCentered.tsx index de8cb8c..0487b35 100644 --- a/src/components/ui/NavbarCentered.tsx +++ b/src/components/ui/NavbarCentered.tsx @@ -1,147 +1,29 @@ -import { useState, useEffect } from "react"; -import { Link } from "react-router-dom"; -import { motion, AnimatePresence } from "motion/react"; -import { Plus, ArrowRight } from "lucide-react"; -import { cls } from "@/lib/utils"; -import Button from "@/components/ui/Button"; +import { useButtonClick } from "@/hooks/useButtonClick"; -interface NavbarCenteredProps { +type NavbarCenteredProps = { logo: string; navItems: { name: string; href: string }[]; ctaButton: { text: string; href: string }; -} - -const NavLink = ({ - href, - onClick, - className, - children, -}: { - href: string; - onClick?: (e: React.MouseEvent) => void; - className: string; - children: React.ReactNode; -}) => { - if (href.startsWith("#")) { - return ( - { - e.preventDefault(); - const element = document.getElementById(href.slice(1)); - element?.scrollIntoView({ behavior: "smooth", block: "start" }); - onClick?.(e); - }} - className={className} - > - {children} - - ); - } - return ( - - {children} - - ); }; -const NavbarCentered = ({ logo, navItems, ctaButton }: NavbarCenteredProps) => { - const [isScrolled, setIsScrolled] = useState(false); - const [menuOpen, setMenuOpen] = useState(false); - - useEffect(() => { - const handleScroll = () => setIsScrolled(window.scrollY > 50); - window.addEventListener("scroll", handleScroll, { passive: true }); - return () => window.removeEventListener("scroll", handleScroll); - }, []); +export default function NavbarCentered({ logo, navItems, ctaButton }: NavbarCenteredProps) { + const handleCtaClick = useButtonClick(ctaButton.href); return ( - <> - ); -}; - -export default NavbarCentered; +} \ No newline at end of file diff --git a/src/index.css b/src/index.css index e71573d..5e0c5cb 100644 --- a/src/index.css +++ b/src/index.css @@ -141,6 +141,7 @@ body { min-height: 100vh; overscroll-behavior: none; overscroll-behavior-y: none; + padding-top: 6rem; } h1, @@ -172,4 +173,4 @@ h6 { background: linear-gradient(to bottom right, color-mix(in srgb, var(--color-secondary-cta) 80%, transparent), var(--color-secondary-cta)); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); border: 1px solid var(--color-secondary-cta); -} +} \ No newline at end of file