diff --git a/app/components/news/header/TopNav.tsx b/app/components/news/header/TopNav.tsx index f5dfd1f..d9247a3 100644 --- a/app/components/news/header/TopNav.tsx +++ b/app/components/news/header/TopNav.tsx @@ -1,6 +1,6 @@ import { Search } from 'lucide-react'; import React, { useState } from 'react'; - +import { Button } from '@/ui/button'; interface MenuItem { label: string; key: string; @@ -60,46 +60,54 @@ export function TopNav({ }; return ( -
+ // 将组件宽度调整为1514px,并保持居中 +
{/* 搜索框与导航菜单组合 */} -
+
{/* 搜索框 */} -
-
- setSearchKeyword(e.target.value)} - placeholder="搜索..." - className="pl-10 pr-4 py-2 text-sm rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-64 transition-all duration-200 hover:shadow-sm" - /> - - - -
-
- {/* 导航菜单 */} -
    +
    + + + setSearchKeyword(e.target.value)} + className="pl-5 pr-4 py-2 text-sm h-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-64 transition-all duration-200 hover:shadow-sm" /> +
    + + + {/* 导航菜单 */} +
      {menuItems.map((item) => { - const isActive = currentActiveKey === item.key; // 判断当前项是否激活 + const isActive = currentActiveKey === item.key; return ( -
    • +
    • ); })}
    + + +
); -}; +}; \ No newline at end of file