Ver código fonte

first commit

周玉环 2 semanas atrás
pai
commit
5c9def4041

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
   "dependencies": {
     "@contentful/f36-components": "^5.9.0",
     "@contentful/f36-icons": "^5.9.0",
+    "@contentful/f36-navbar": "^5.9.0",
     "@contentful/f36-tokens": "^5.1.0",
     "@emotion/react": "^11.14.0",
     "@emotion/styled": "^11.14.1",

+ 28 - 0
pnpm-lock.yaml

@@ -14,6 +14,9 @@ importers:
       '@contentful/f36-icons':
         specifier: ^5.9.0
         version: 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-navbar':
+        specifier: ^5.9.0
+        version: 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
       '@contentful/f36-tokens':
         specifier: ^5.1.0
         version: 5.1.0
@@ -333,6 +336,12 @@ packages:
       react: '>=16.8'
       react-dom: '>=16.8'
 
+  '@contentful/f36-navbar@5.9.0':
+    resolution: {integrity: sha512-QiP5ymXSVqbSAMFGRBeHw2aDA/i6NDcwbpCwYDDS4eRJY/aoJgq+01acMHk0JvkIlGSi0E49j3KT22Okpco+Og==}
+    peerDependencies:
+      react: '>=16.8'
+      react-dom: '>=16.8'
+
   '@contentful/f36-navlist@5.9.0':
     resolution: {integrity: sha512-d9D5B6aJu01ITN99GH4hKGtMk09zkOlwdm95sGVNv8WftBhrTACGgdIYBmp6KO+1xbBRnf9yqyRzcBvK2Xq1Rw==}
     peerDependencies:
@@ -2482,6 +2491,25 @@ snapshots:
       - '@types/react'
       - supports-color
 
+  '@contentful/f36-navbar@5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)':
+    dependencies:
+      '@contentful/f36-avatar': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-button': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-core': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-icon': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-icons': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-menu': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-skeleton': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-tokens': 5.1.0
+      '@contentful/f36-tooltip': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-typography': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      '@contentful/f36-utils': 5.2.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
+      emotion: 10.0.27
+      react: 19.2.0
+      react-dom: 19.2.0(react@19.2.0)
+    transitivePeerDependencies:
+      - supports-color
+
   '@contentful/f36-navlist@5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)':
     dependencies:
       '@contentful/f36-core': 5.9.0(react-dom@19.2.0(react@19.2.0))(react@19.2.0)

+ 0 - 0
src/components/SearchModal/index.module.css


+ 27 - 0
src/components/SearchModal/index.tsx

@@ -0,0 +1,27 @@
+import { Modal, Badge } from "@contentful/f36-components";
+import { useState } from "react";
+import styles from "./index.module.css";
+
+interface SearchModalProps {
+  isOpen: boolean;
+  onClose: () => void;
+}
+
+export default function SearchModal({ isOpen, onClose }: SearchModalProps) {
+  const [searchQuery, setSearchQuery] = useState("");
+
+  const handleClose = () => {
+    setSearchQuery("");
+    onClose();
+  };
+
+  return (
+    <Modal
+      isShown={isOpen}
+      onClose={handleClose}
+      className={styles.modal}
+    >
+      <div className={styles.search_wrap}></div>
+    </Modal>
+  );
+}

+ 0 - 426
src/layouts/Header/index.module.css

@@ -1,426 +0,0 @@
-.header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding: 16px;
-  height: 60px;
-  /* border-bottom: 1px solid #e5e8eb; */
-  background-color: #f7f9fa;
-}
-
-.left {
-  display: flex;
-  align-items: center;
-  gap: 16px;
-  flex: 1;
-}
-
-/* Mobile Menu Button */
-.mobileMenuButton {
-  display: none;
-  justify-content: center;
-  align-items: center;
-  gap: 8px;
-  padding: 8px 12px;
-  background: #fff;
-  border: 1px solid #d3dce0;
-  border-radius: 6px;
-  cursor: pointer;
-  font-size: 15px;
-  color: rgb(17, 27, 43);
-  transition: all 0.2s;
-}
-
-.mobileMenuButton:hover {
-  border-color: #b8c4ce;
-  /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); */
-    background-color: #e8ebed;
-
-}
-
-.logo {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 32px;
-  height: 32px;
-  cursor: pointer;
-}
-
-.logo svg {
-  width: 24px;
-  height: 24px;
-}
-
-.loading {
-  font-size: 13px;
-  color: #999;
-  padding: 0 12px;
-}
-
-/* Card Navigation */
-.menuCards {
-  display: flex;
-  align-items: center;
-  gap: 8px;
-  height: 100%;
-}
-
-.menuCardWrapper {
-  position: relative;
-  height: 100%;
-  display: flex;
-  align-items: center;
-}
-
-.menuCard {
-  display: flex;
-  align-items: center;
-  gap: 6px;
-  padding: 6px 14px;
-  height: 30px;
-  background-color: rgb(247, 249, 250);
-  border: 1px solid transparent;
-  border-radius: 6px;
-  cursor: pointer;
-  font-size: 13px;
-  color: rgb(27, 39, 58);
-  transition: all 0.2s;
-  font-weight: 400;
-}
-
-.menuCard:hover {
-  /* border-color: #b8c4ce; */
-  /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); */
-  background-color: #e8ebed;
-}
-
-.menuCardActive {
-  background: none rgb(232, 245, 255);
-  border: 1px solid rgb(64, 160, 255);
-  color: rgb(0, 89, 200);
-  font-weight: 500;
-}
-
-.menuCardActive:hover {
-  border-color: #0052cc;
-  color: #0052cc;
-}
-
-.menuIcon {
-  font-size: 16px;
-  display: flex;
-  align-items: center;
-  /* line-height: 1; */
-}
-
-.menuText {
-  font-weight: 500;
-  white-space: nowrap;
-}
-
-.menuArrow {
-  font-size: 10px;
-  opacity: 0.7;
-  margin-left: 2px;
-}
-
-/* Dropdown Menu */
-.dropdown {
-  position: absolute;
-  top: calc(100% + 2px);
-  left: 0;
-  min-width: 180px;
-  background: white;
-  border: 1px solid #d3dce0;
-  border-radius: 6px;
-  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
-  padding: 4px;
-  z-index: 1000;
-  animation: dropdownFadeIn 0.15s ease-out;
-}
-
-/* 添加一个不可见的桥接区域,防止鼠标移动时下拉菜单消失 */
-.dropdown::before {
-  content: "";
-  position: absolute;
-  top: -6px;
-  left: 0;
-  right: 0;
-  height: 6px;
-  background: transparent;
-}
-
-@keyframes dropdownFadeIn {
-  from {
-    opacity: 0;
-    transform: translateY(-8px);
-  }
-  to {
-    opacity: 1;
-    transform: translateY(0);
-  }
-}
-
-.dropdownItem {
-  display: block;
-  width: 100%;
-  padding: 8px 12px;
-  text-align: left;
-  background: transparent;
-  border: none;
-  border-radius: 4px;
-  cursor: pointer;
-  font-size: 13px;
-  color: #536171;
-  transition: all 0.15s;
-  white-space: nowrap;
-}
-
-.dropdownItem:hover {
-  background: #f7f9fa;
-  color: #0066ff;
-}
-
-/* Responsive Design */
-@media (max-width: 1024px) {
-  .menuCards {
-    display: none;
-  }
-
-  .mobileMenuButton {
-    display: flex;
-  }
-
-  .envSelector {
-    display: none;
-  }
-}
-
-@media (max-width: 768px) {
-  .header {
-    padding: 0 12px;
-  }
-
-  .actions {
-    gap: 2px;
-  }
-
-  .iconButton {
-    width: 28px;
-    height: 28px;
-  }
-}
-
-/* Right Side */
-.right {
-  display: flex;
-  align-items: center;
-  gap: 12px;
-}
-
-.envSelector {
-  display: flex;
-  align-items: center;
-  gap: 8px;
-}
-
-.branchButton {
-  min-width: 80px;
-}
-
-.actions {
-  display: flex;
-  align-items: center;
-  gap: 4px;
-  padding-left: 12px;
-  /* border-left: 1px solid #e5e8eb; */
-}
-
-.iconButton {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 32px;
-  height: 32px;
-  background: transparent;
-  border: none;
-  border-radius: 4px;
-  cursor: pointer;
-  font-size: 16px;
-  transition: background-color 0.2s;
-}
-
-.iconButton:hover {
-  background-color: rgba(0, 0, 0, 0.05);
-}
-
-.avatar {
-  width: 24px;
-  height: 24px;
-  border-radius: 50%;
-  background-color: #e5e8eb;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 12px;
-}
-
-
-/* Mobile Menu */
-.mobileMenuWrapper {
-  position: relative;
-  display: none;
-}
-
-.mobileMenuButton {
-  display: flex;
-  align-items: center;
-  gap: 8px;
-  padding: 6px 12px;
-  background: white;
-  border: 1px solid #d3dce0;
-  border-radius: 6px;
-  cursor: pointer;
-  font-size: 13px;
-  color: #536171;
-  transition: all 0.2s;
-}
-
-.mobileMenuButton:hover {
-  border-color: #b8c4ce;
-  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
-}
-
-.menuIcon {
-  font-size: 16px;
-  line-height: 1;
-}
-
-/* Mobile Menu Dropdown */
-.mobileMenuDropdown {
-  position: absolute;
-  top: calc(100% + 2px);
-  left: 0;
-  min-width: 240px;
-  background: white;
-  border: 1px solid #d3dce0;
-  border-radius: 6px;
-  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
-  padding: 4px;
-  z-index: 1000;
-  animation: dropdownFadeIn 0.15s ease-out;
-}
-
-/* 添加桥接区域,防止鼠标移动时下拉菜单消失 */
-.mobileMenuDropdown::before {
-  content: "";
-  position: absolute;
-  top: -6px;
-  left: 0;
-  right: 0;
-  height: 6px;
-  background: transparent;
-}
-
-.mobileMenuItem {
-  position: relative;
-}
-
-.mobileMenuItemButton {
-  display: flex;
-  align-items: center;
-  gap: 10px;
-  width: 100%;
-  padding: 10px 12px;
-  text-align: left;
-  background: transparent;
-  border: none;
-  border-radius: 4px;
-  cursor: pointer;
-  font-size: 14px;
-  color: #536171;
-  transition: all 0.15s;
-}
-
-.mobileMenuItemButton:hover {
-  background: #f7f9fa;
-}
-
-.mobileMenuItemActive {
-  background: #e8ebed;
-  color: #1a1a1a;
-  font-weight: 500;
-}
-
-.mobileMenuItemIcon {
-  font-size: 16px;
-  display: flex;
-  align-items: center;
-}
-
-.mobileMenuItemText {
-  flex: 1;
-}
-
-.mobileMenuItemArrow {
-  font-size: 18px;
-  color: #999;
-}
-
-/* Mobile Submenu */
-.mobileSubmenu {
-  position: absolute;
-  top: 0;
-  left: calc(100% + 2px);
-  min-width: 200px;
-  background: white;
-  border: 1px solid #d3dce0;
-  border-radius: 6px;
-  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
-  padding: 4px;
-  z-index: 1001;
-  animation: dropdownFadeIn 0.15s ease-out;
-}
-
-/* 添加左侧桥接区域 */
-.mobileSubmenu::before {
-  content: "";
-  position: absolute;
-  top: 0;
-  left: -6px;
-  bottom: 0;
-  width: 6px;
-  background: transparent;
-}
-
-.mobileSubmenuItem {
-  display: block;
-  width: 100%;
-  padding: 10px 12px;
-  text-align: left;
-  background: transparent;
-  border: none;
-  border-radius: 4px;
-  cursor: pointer;
-  font-size: 14px;
-  color: #536171;
-  transition: all 0.15s;
-  white-space: nowrap;
-}
-
-.mobileSubmenuItem:hover {
-  background: #f7f9fa;
-  color: #0066ff;
-}
-
-/* Responsive - Show mobile menu on smaller screens */
-@media (max-width: 1024px) {
-  .menuCards {
-    display: none;
-  }
-
-  .mobileMenuWrapper {
-    display: block;
-  }
-}

+ 183 - 190
src/layouts/Header/index.tsx

@@ -1,11 +1,15 @@
-// import { Button } from "@contentful/f36-components";
-import { GearSixIcon, ListIcon } from "@contentful/f36-icons";
+import { Navbar } from "@contentful/f36-navbar";
+import {
+  MagnifyingGlassIcon,
+  QuestionIcon,
+  GearSixIcon,
+} from "@contentful/f36-icons";
 import { useAuth } from "../../contexts/AuthContext";
 import { useMenu } from "../../contexts/MenuContext";
 import { useNavigate, useLocation } from "react-router-dom";
 import { useEffect, useState } from "react";
 import type { JeecgMenu } from "../../types/menu";
-import styles from "./index.module.css";
+import SearchModal from "../../components/SearchModal";
 
 export default function Header() {
   const { menus, loading } = useAuth();
@@ -13,8 +17,7 @@ export default function Header() {
     useMenu();
   const navigate = useNavigate();
   const location = useLocation();
-  const [hoveredMenu, setHoveredMenu] = useState<JeecgMenu | null>(null);
-  const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
+  const [isSearchOpen, setIsSearchOpen] = useState(false);
 
   // 获取顶级菜单(一级菜单)
   const topMenus = menus.filter((menu) => !menu.hidden && !menu.meta?.hideMenu);
@@ -25,7 +28,6 @@ export default function Header() {
     const segments = path.split("/").filter(Boolean);
     const firstPath = segments[0];
 
-    // 尝试匹配一级菜单
     const matchedMenu = topMenus.find((menu) => {
       const menuPath = menu.path || "";
       const menuSegments = menuPath.split("/").filter(Boolean);
@@ -44,200 +46,191 @@ export default function Header() {
     setActiveSecondMenu,
   ]);
 
-  const handleMenuClick = (menu: (typeof topMenus)[0]) => {
-    console.log("Header: Clicked menu", menu.name, menu.path);
-
-    const hasChildren = menu.children && menu.children.length > 0;
-
-    // 如果有子菜单,只设置激活状态,不跳转
-    if (hasChildren) {
+  // 处理菜单点击
+  const handleMenuClick = (menu: JeecgMenu, child?: JeecgMenu) => {
+    if (child) {
+      // 点击子菜单
       setActiveFirstMenu(menu);
-      setActiveSecondMenu(null);
-      // 不导航,让用户点击下拉菜单中的选项
+      setActiveSecondMenu(child);
+      navigate(child.path || "");
     } else {
-      // 没有子菜单,直接导航到该菜单
+      // 点击一级菜单(无子菜单)
       setActiveFirstMenu(menu);
       setActiveSecondMenu(null);
-      const menuPath = menu.path || "";
-      console.log("Header: Navigating to menu", menuPath);
-      navigate(menuPath);
+      navigate(menu.path || "");
     }
   };
 
-  return (
-    <header className={styles.header}>
-      <div className={styles.left}>
-        {/* Logo */}
-        <div className={styles.logo}>
-          <svg width="24" height="24" viewBox="0 0 24 24" fill="none">
-            <circle cx="12" cy="12" r="10" fill="#0066ff" />
-            <path
-              d="M8 12L11 15L16 9"
-              stroke="white"
-              strokeWidth="2"
-              strokeLinecap="round"
-              strokeLinejoin="round"
+  // 跳转到权限管理
+  const toPermissionPage = () => {
+    debugger;
+  }
+
+  if (loading) {
+    return <div style={{ padding: "16px" }}>加载中...</div>;
+  }
+
+  // 渲染主导航(桌面端)
+  const mainNavigation = (
+    <>
+      {topMenus.map((menu) => {
+        const hasChildren = menu.children && menu.children.length > 0;
+        const isActive = activeFirstMenu?.id === menu.id;
+
+        if (hasChildren) {
+          // 有子菜单的项目
+          return (
+            <Navbar.Item
+              key={menu.id}
+              title={menu.meta?.title || menu.name}
+              isActive={isActive}
+            >
+              {menu.children
+                ?.filter((child) => !child.hidden && !child.meta?.hideMenu)
+                .map((child) => (
+                  <Navbar.MenuItem
+                    key={child.id}
+                    title={child.meta?.title || child.name}
+                    onClick={() => handleMenuClick(menu, child)}
+                  />
+                ))}
+            </Navbar.Item>
+          );
+        } else {
+          // 无子菜单的项目
+          return (
+            <Navbar.Item
+              key={menu.id}
+              title={menu.meta?.title || menu.name}
+              isActive={isActive}
+              onClick={() => handleMenuClick(menu)}
             />
-          </svg>
-        </div>
-
-        {/* Mobile Menu Button */}
-        <div
-          className={styles.mobileMenuWrapper}
-          onMouseEnter={() => setMobileMenuOpen(true)}
-          onMouseLeave={() => setMobileMenuOpen(false)}
-        >
-          <button className={styles.mobileMenuButton}>
-            <span className={styles.menuIcon}><ListIcon /></span>
-            <span>Menu</span>
-          </button>
-
-          {/* Mobile Menu Dropdown */}
-          {mobileMenuOpen && (
-            <div className={styles.mobileMenuDropdown}>
-              {topMenus.map((menu) => {
-                const hasChildren = menu.children && menu.children.length > 0;
-                const isActive = activeFirstMenu?.id === menu.id;
-
-                return (
-                  <div
-                    key={menu.id}
-                    className={styles.mobileMenuItem}
-                    onMouseEnter={() => hasChildren && setHoveredMenu(menu)}
-                    onMouseLeave={() => setHoveredMenu(null)}
-                  >
-                    <button
-                      className={`${styles.mobileMenuItemButton} ${
-                        isActive ? styles.mobileMenuItemActive : ""
-                      }`}
-                      onClick={() => !hasChildren && handleMenuClick(menu)}
-                    >
-                      <span className={styles.mobileMenuItemText}>
-                        {menu.meta?.title || menu.name}
-                      </span>
-                      {hasChildren && (
-                        <span className={styles.mobileMenuItemArrow}>›</span>
-                      )}
-                    </button>
-
-                    {/* Submenu */}
-                    {hasChildren && hoveredMenu?.id === menu.id && (
-                      <div className={styles.mobileSubmenu}>
-                        {menu.children
-                          ?.filter((child) => !child.hidden && !child.meta?.hideMenu)
-                          .map((child) => {
-                            const childPath = child.path || "";
-                            const parentPath = menu.path || "";
-                            const fullPath = childPath.startsWith("/")
-                              ? childPath
-                              : `${parentPath}/${childPath}`;
-
-                            return (
-                              <button
-                                key={child.id}
-                                className={styles.mobileSubmenuItem}
-                                onClick={() => {
-                                  setActiveFirstMenu(menu);
-                                  setActiveSecondMenu(child);
-                                  setMobileMenuOpen(false);
-                                  setHoveredMenu(null);
-                                  navigate(fullPath);
-                                }}
-                              >
-                                {child.meta?.title || child.name}
-                              </button>
-                            );
-                          })}
-                      </div>
-                    )}
-                  </div>
-                );
-              })}
-            </div>
-          )}
-        </div>
-
-        {/* Card Navigation */}
-        {loading ? (
-          <div className={styles.loading}>加载中...</div>
-        ) : (
-          <nav className={styles.menuCards}>
-            {topMenus.map((menu) => {
-              const isActive = activeFirstMenu?.id === menu.id;
-              const hasChildren = menu.children && menu.children.length > 0;
-
-              return (
-                <div
-                  key={menu.id}
-                  className={styles.menuCardWrapper}
-                  onMouseEnter={() => hasChildren && setHoveredMenu(menu)}
-                  onMouseLeave={() => setHoveredMenu(null)}
-                >
-                  <button
-                    className={`${styles.menuCard} ${
-                      isActive ? styles.menuCardActive : ""
-                    }`}
-                    onClick={() => handleMenuClick(menu)}
-                  >
-                    <span className={styles.menuText}>
-                      {menu.meta?.title || menu.name}
-                    </span>
-                    {hasChildren && <span className={styles.menuArrow}>▼</span>}
-                  </button>
-
-                  {/* 下拉菜单 */}
-                  {hasChildren && hoveredMenu?.id === menu.id && (
-                    <div className={styles.dropdown}>
-                      {menu.children
-                        ?.filter(
-                          (child) => !child.hidden && !child.meta?.hideMenu
-                        )
-                        .map((child) => {
-                          // 构建完整路径
-                          const childPath = child.path || "";
-                          const parentPath = menu.path || "";
+          );
+        }
+      })}
+    </>
+  );
 
-                          // 如果子路径是绝对路径,直接使用
-                          // 否则拼接父路径
-                          const fullPath = childPath.startsWith("/")
-                            ? childPath
-                            : `${parentPath}/${childPath}`;
+  // 渲染移动端导航
+  const mobileNavigation = (
+    <>
+      {topMenus.map((menu) => {
+        const hasChildren = menu.children && menu.children.length > 0;
+
+        if (hasChildren) {
+          // 有子菜单的项目
+          return (
+            <Navbar.Submenu key={menu.id} title={menu.meta?.title || menu.name}>
+              {menu.children
+                ?.filter((child) => !child.hidden && !child.meta?.hideMenu)
+                .map((child) => (
+                  <Navbar.MenuItem
+                    key={child.id}
+                    title={child.meta?.title || child.name}
+                    onClick={() => handleMenuClick(menu, child)}
+                  />
+                ))}
+            </Navbar.Submenu>
+          );
+        } else {
+          // 无子菜单的项目
+          return (
+            <Navbar.MenuItem
+              key={menu.id}
+              title={menu.meta?.title || menu.name}
+              onClick={() => handleMenuClick(menu)}
+            />
+          );
+        }
+      })}
+    </>
+  );
 
-                          return (
-                            <button
-                              key={child.id}
-                              className={styles.dropdownItem}
-                              onClick={() => {
-                                setActiveFirstMenu(menu);
-                                setActiveSecondMenu(child);
-                                setHoveredMenu(null);
-                                navigate(fullPath);
-                              }}
-                            >
-                              {child.meta?.title || child.name}
-                            </button>
-                          );
-                        })}
-                    </div>
-                  )}
-                </div>
-              );
-            })}
-          </nav>
-        )}
-      </div>
+  // 右侧辅助导航
+  const secondaryNavigation = (
+    <>
+      <Navbar.Item
+        label="快速搜索"
+        icon={<MagnifyingGlassIcon />}
+        onClick={() => setIsSearchOpen(true)}
+      />
+      <Navbar.Item label="帮助菜单" icon={<QuestionIcon />}>
+        <Navbar.MenuItem
+          as="a"
+          target="_blank"
+          rel="noopener noreferrer"
+          title="帮助中心"
+          href="https://www.contentful.com/help/"
+        />
+        <Navbar.MenuItem
+          as="a"
+          target="_blank"
+          rel="noopener noreferrer"
+          title="开发者文档"
+          href="https://www.contentful.com/developers/docs/"
+        />
+        <Navbar.MenuDivider />
+        <Navbar.MenuItem
+          as="a"
+          target="_blank"
+          rel="noopener noreferrer"
+          title="获取支持"
+          href="https://support.contentful.com"
+        />
+      </Navbar.Item>
+      <Navbar.Item label="设置菜单" icon={<GearSixIcon />}>
+        <Navbar.MenuSectionTitle>通用</Navbar.MenuSectionTitle>
+        <Navbar.MenuItem title="首页" />
+        <Navbar.MenuItem title="API 密钥" />
+        <Navbar.MenuSectionTitle>空间</Navbar.MenuSectionTitle>
+        <Navbar.MenuItem title="应用" />
+        <Navbar.MenuItem title="权限" onClick={toPermissionPage} />
+      </Navbar.Item>
+    </>
+  );
 
-      <div className={styles.right}>
-        {/* Action Icons */}
-        <div className={styles.actions}>
-          <button className={styles.iconButton} title="Settings">
-            <GearSixIcon size="small" />
-          </button>
-          <button className={styles.iconButton} title="User">
-            <div className={styles.avatar}>👤</div>
-          </button>
-        </div>
-      </div>
-    </header>
+  return (
+    <>
+      <Navbar
+        mainNavigation={mainNavigation}
+        mobileNavigation={mobileNavigation}
+        // switcher={
+        //   <Navbar.Switcher
+        //     isAlias={false}
+        //     envVariant="master"
+        //     space="Content Space"
+        //     environment="master"
+        //   />
+        // }
+        secondaryNavigation={secondaryNavigation}
+        account={
+          <Navbar.Account username="管理员" initials="A" label="账户设置">
+            <Navbar.MenuItem title="账户设置" />
+            <Navbar.MenuItem title="控制台" />
+            <Navbar.MenuDivider />
+            <Navbar.MenuItem
+              title="外部链接"
+              as="a"
+              href="https://www.contentful.com"
+              target="_blank"
+              rel="noopener noreferrer"
+            />
+            <Navbar.MenuDivider />
+            <Navbar.MenuItem title="退出登录" />
+          </Navbar.Account>
+        }
+        aria={{
+          labelMainNavigation: "主导航",
+          labelSecondaryNavigation: "辅助导航",
+          labelAccount: "我的账户",
+        }}
+      />
+
+      {/* 搜索对话框 */}
+      <SearchModal
+        isOpen={isSearchOpen}
+        onClose={() => setIsSearchOpen(false)}
+      />
+    </>
   );
 }