/* eslint-disable no-unused-vars */ import { Box, Image } from "@chakra-ui/react"; import { Outlet, Link, useLocation } from "react-router-dom"; import { useEffect, useState } from "react"; import logo from "../../assets/images/rubix.png"; import { MobileMenu } from "../MobileMenu/MobileMenu"; import arrow from "../../assets/images/arrow.png"; const NavBar = () => { const [isScrolled, setIsScrolled] = useState(false); const [windowWidth, setWindowWidth] = useState(window.innerWidth); const location = useLocation(); const linkStyle = { width: "0", }; const active = { content: "''", position: "absolute", bottom: "-5px", left: "50%", width: "130%", height: "3px", backgroundColor: "#DE858E", borderRadius: "10px", transform: "translateX(-50%)", transition: "all .3s", }; useEffect(() => { const handleScroll = () => { const scrollPosition = window.scrollY; setIsScrolled(scrollPosition > 0); }; const handleResize = () => { setWindowWidth(window.innerWidth); }; window.addEventListener("scroll", handleScroll); window.addEventListener("resize", handleResize); return () => { window.removeEventListener("scroll", handleScroll); window.removeEventListener("resize", handleResize); }; }, []); const isMobile = windowWidth <= 996; return ( <> {!isMobile ? ( <> WALLET EXPLORER LEARN BUILD USE CASES COMMUNITY FOUNDATION { const arrowRight = document.querySelector(".arrow"); arrowRight.style.transform = "rotate(45deg)"; }} onMouseLeave={(e) => { const arrowRight = document.querySelector(".arrow"); arrowRight.style.transform = "none"; }} > CONTACT US ) : ( )} ); }; export default NavBar;