diff --git a/src/components/MobileMenu.jsx b/src/components/MobileMenu.jsx new file mode 100644 index 0000000..e2ba088 --- /dev/null +++ b/src/components/MobileMenu.jsx @@ -0,0 +1,100 @@ +import { useState } from 'react'; + +export default function MobileMenu({ currentPath }) { + const [isOpen, setIsOpen] = useState(false); + + const links = [ + { href: '/', label: 'Home' }, + { href: '/about', label: 'About' }, + { href: '/contact', label: 'Contact' }, + ]; + + return ( + <> + {/* Hamburger Button */} + + + {/* Mobile Menu Overlay */} + {isOpen && ( +
setIsOpen(false)} + /> + )} + + {/* Mobile Menu Panel */} +
+
+ {/* Header */} +
+ Menu + +
+ + {/* Navigation Links */} + + + {/* Footer */} +
+

Astro Starter Kit

+
+
+
+ + ); +} diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 689ddab..e120ebb 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -1,4 +1,6 @@ --- +import MobileMenu from "./MobileMenu.jsx"; + const currentPath = Astro.url.pathname; --- @@ -12,7 +14,8 @@ const currentPath = Astro.url.pathname; Starter Kit -
+ {/* Desktop Navigation */} + + + {/* Mobile Menu */} +