fix(ui): 统一下载页主题与智能路由页签间距

This commit is contained in:
zhanjunhao
2026-11-18 17:39:19 +08:00
parent 89188a9a65
commit ed0c06a93c
12 changed files with 253 additions and 324 deletions
+22 -48
View File
@@ -19,7 +19,11 @@ For commercial licensing, please contact support@quantumnous.com
import React from 'react';
import { Link, useLocation } from 'react-router-dom';
import { Dropdown } from '@/components/ui';
import { Dropdown } from 'antd';
import {
ChevronDown,
ExternalLink,
} from '@/components/common/icons/ActionIcons';
import { useTranslation } from 'react-i18next';
import SkeletonWrapper from '../components/SkeletonWrapper';
import { isNavigationPathActive } from '../../console/consoleRoutes';
@@ -68,44 +72,27 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
return (
<Dropdown
key={link.itemKey}
trigger={'hover'}
position={'bottomLeft'}
render={
<Dropdown.Menu>
{link.items.map((subItem) => (
<Dropdown.Item key={subItem.itemKey}>
<Link
to={subItem.to}
className='block w-full py-0.5 text-gray-700 dark:text-neutral-200 hover:text-brand-deep dark:hover:text-brand-from transition-colors'
style={{ textDecoration: 'none' }}
>
{subItem.text}
</Link>
</Dropdown.Item>
))}
</Dropdown.Menu>
}
trigger={['hover', 'click']}
placement='bottomLeft'
menu={{
selectedKeys: link.items
.filter((item) => isPathActive(item.to))
.map((item) => item.itemKey),
items: link.items.map((subItem) => ({
key: subItem.itemKey,
label: <Link to={subItem.to}>{subItem.text}</Link>,
})),
}}
>
<div
<button
type='button'
className={`${finalClasses} cursor-pointer`}
aria-haspopup='menu'
aria-current={isActive ? 'page' : undefined}
>
{linkContent}
{/* Dropdown arrow */}
<svg
className='w-3.5 h-3.5 opacity-50 group-hover:opacity-100 transition-all duration-300 group-hover:rotate-180'
fill='none'
viewBox='0 0 24 24'
stroke='currentColor'
>
<path
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={2}
d='M19 9l-7 7-7-7'
/>
</svg>
</div>
<ChevronDown size={14} aria-hidden />
</button>
</Dropdown>
);
}
@@ -120,20 +107,7 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
className={`${baseClasses} ${spacingClasses} ${defaultClasses} ${hoverClasses}`}
>
{linkContent}
{/* External link icon */}
<svg
className='w-3 h-3 opacity-50 group-hover:opacity-100 transition-opacity'
fill='none'
viewBox='0 0 24 24'
stroke='currentColor'
>
<path
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={2}
d='M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14'
/>
</svg>
<ExternalLink size={12} aria-hidden />
</a>
);
}