import "./styles.sass"; import Logo from "@/common/assets/logo192.png"; import { faXmark, faBars, faArrowUpRightFromSquare, } from "@fortawesome/free-solid-svg-icons"; import { faGithub } from "@fortawesome/free-brands-svg-icons"; import { Link, useLocation } from "react-router-dom"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useState, useEffect } from "react"; import { DOCUMENTATION_ROOT } from "@/common/utils/constants"; export const GITHUB_LINK = "https://github.com/ikhsanddy/pixies"; const NAV_ITEMS = [ { path: "/", label: "Home", isExternal: false }, { path: "/install", label: "Install", isExternal: false }, { path: "/tutorials", label: "Tutorials", isExternal: false }, { path: DOCUMENTATION_ROOT, label: "Docs", isExternal: true }, ]; export const Navigation = () => { const [mobileOpen, setMobileOpen] = useState(false); const [scrolled, setScrolled] = useState(false); const location = useLocation(); useEffect(() => { const handleScroll = () => { setScrolled(window.scrollY > 20); }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); useEffect(() => { setMobileOpen(false); }, [location]); const isActive = (path) => location.pathname === path; return ( <>