-
Powered by TenantCMS
-
- Using X-Tenant-Slug for multi-tenant authentication
-
+
- )
-}
+ );
+};
+
+export default Footer;
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index ce6a246..bd27cbb 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -1,19 +1,177 @@
-import React from 'react'
+import { useState, useEffect, useCallback } from 'react';
+import { Link, useLocation } from 'react-router-dom';
+import { motion, AnimatePresence } from 'framer-motion';
+import { Menu, X, Building2 } from 'lucide-react';
+import { NAVIGATION_MENU } from '../../lib/constants';
+/**
+ * Header 组件 - 企业官网导航栏
+ */
export const Header: React.FC = () => {
+ const [isScrolled, setIsScrolled] = useState(false);
+ const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
+ const location = useLocation();
+
+ // 监听滚动事件
+ useEffect(() => {
+ const handleScroll = () => {
+ setIsScrolled(window.scrollY > 20);
+ };
+
+ window.addEventListener('scroll', handleScroll);
+ return () => window.removeEventListener('scroll', handleScroll);
+ }, []);
+
+ // 关闭移动端菜单 - 使用回调避免直接 setState
+ const closeMobileMenu = useCallback(() => {
+ setIsMobileMenuOpen(false);
+ }, []);
+
+ useEffect(() => {
+ closeMobileMenu();
+ }, [location.pathname, closeMobileMenu]);
+
+ // 检查当前路径是否为活动状态
+ const isActive = (path: string): boolean => {
+ if (path === '/') {
+ return location.pathname === '/';
+ }
+ return location.pathname.startsWith(path);
+ };
+
return (
-
-
-
-
- TenantCMS Demo
-
-