diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx index a676e6b..d8fe26e 100644 --- a/src/components/Layout.jsx +++ b/src/components/Layout.jsx @@ -2,118 +2,21 @@ import { Link, useLocation } from "react-router-dom"; import { useEffect, useState } from "react"; import Footer from "./Footer"; import SponsorTicker from "./SponsorTicker"; -import ButtonLink from "./ButtonLink"; +import Navbar from "./Navbar"; const Layout = ({ children }) => { const location = useLocation(); - const [showHeader, setShowHeader] = useState(true); // Scroll to top when location changes useEffect(() => { window.scrollTo(0, 0); }, [location.pathname]); - const navItems = [ - { path: "/", label: "Home" }, - { path: "/about", label: "About" }, - { path: "/projects", label: "Projects" }, - { path: "/development-programs", label: "Development Programs" }, - { path: "/showcase", label: "Showcase" }, - { path: "/apply", label: "Apply" }, - ]; - const sponsorItem = { path: "/sponsorship", label: "Looking to Sponsor?" }; return (
- {/* Navigation */} - {!showHeader && ( - - )} - {showHeader && ( - - )} - - {/* ...existing code... */} + {/* Main Content */}
{children}
diff --git a/src/components/Navbar.css b/src/components/Navbar.css new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx new file mode 100644 index 0000000..512bf1a --- /dev/null +++ b/src/components/Navbar.jsx @@ -0,0 +1,106 @@ +import { Link } from "react-router-dom"; +import { useState } from "react"; +import ButtonLink from "./ButtonLink"; + +import "./Navbar.css"; +export default function Navbar({}) { + const [showHeader, setShowHeader] = useState(true); + const navItems = [ + { path: "/", label: "Home" }, + { path: "/about", label: "About" }, + { path: "/projects", label: "Projects" }, + { path: "/development-programs", label: "Development Programs" }, + { path: "/showcase", label: "Showcase" }, + { path: "/apply", label: "Apply" }, + ]; + + return ( +
+ {!showHeader && ( + + )} + {showHeader && ( + + )} +
+ ); +}