import classNames from "classnames"; import { useEffect } from "react"; import { NavLink, useLocation } from "react-router-dom"; import { useGlobalStore, useLayoutStore, useUserStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import { resolution } from "@/utils/layout"; import Icon from "./Icon"; import UpgradeVersionView from "./UpgradeVersionBanner"; import UserBanner from "./UserBanner"; const Header = () => { const t = useTranslate(); const location = useLocation(); const globalStore = useGlobalStore(); const userStore = useUserStore(); const layoutStore = useLayoutStore(); const showHeader = layoutStore.state.showHeader; const isVisitorMode = userStore.isVisitorMode() && !userStore.state.user; useEffect(() => { const handleWindowResize = () => { if (window.innerWidth < resolution.sm) { layoutStore.setHeaderStatus(false); } else { layoutStore.setHeaderStatus(true); } }; window.addEventListener("resize", handleWindowResize); handleWindowResize(); }, [location]); return (