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

This commit is contained in:
zhanjunhao
2026-11-18 17:39:19 +08:00
parent b416b21bda
commit be2b670ab3
12 changed files with 253 additions and 324 deletions
@@ -20,7 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
import { Compass as ActionCompass } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { Button, Dropdown } from '@/components/ui';
import { Button, Dropdown } from 'antd';
import { ExternalLink } from 'lucide-react';
import { isNavigationPathActive } from '../../console/consoleRoutes';
@@ -92,63 +92,51 @@ const MobileNavMenu = ({ mainNavLinks, userState, t }) => {
return (
<Dropdown
trigger='click'
position='bottomLeft'
visible={visible}
onVisibleChange={setVisible}
render={
<Dropdown.Menu className='!min-w-[168px] !p-1.5 !rounded-xl !border !border-gray-100 dark:!border-neutral-800 !shadow-xl !shadow-gray-200/50 dark:!shadow-black/30 !backdrop-blur-xl !bg-white/95 dark:!bg-neutral-900/95'>
{menuItems.map((item) => (
<Dropdown.Item
key={item.key}
onClick={() => {
setVisible(false);
if (item.externalLink) {
window.open(
item.externalLink,
'_blank',
'noopener,noreferrer',
);
} else if (item.to) {
navigate(item.to);
}
}}
className={`!rounded-lg !my-0.5 !px-3 !py-2 !text-sm !transition-colors ${
item.active
? '!bg-brand/10 dark:!bg-brand-deep/40 !text-brand-deep dark:!text-brand-from !font-semibold'
: '!text-gray-700 dark:!text-neutral-200'
}`}
trigger={['click']}
placement='bottomLeft'
open={visible}
onOpenChange={setVisible}
menu={{
selectedKeys: menuItems
.filter((item) => item.active)
.map((item) => item.key),
items: menuItems.map((item) => ({
key: item.key,
onClick: () => {
setVisible(false);
if (item.externalLink) {
window.open(item.externalLink, '_blank', 'noopener,noreferrer');
} else if (item.to) {
navigate(item.to);
}
},
label: (
<span
className='flex items-center gap-1.5'
aria-current={item.active ? 'page' : undefined}
>
<span
className='flex items-center gap-1.5'
aria-current={item.active ? 'page' : undefined}
>
{item.text}
{item.externalLink && (
<ExternalLink size={12} className='opacity-50' />
)}
</span>
</Dropdown.Item>
))}
</Dropdown.Menu>
}
{item.text}
{item.externalLink && (
<ExternalLink size={12} className='opacity-50' />
)}
</span>
),
})),
}}
>
<span className='inline-flex'>
<Button
theme='borderless'
type='tertiary'
aria-label={t('主导航')}
title={activeItem?.text}
aria-haspopup='menu'
aria-expanded={visible}
icon={<ActionCompass size={16} />}
className='!ml-1 !px-2 !h-8 max-w-[9rem] !rounded-xl !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-all !duration-200 active:!scale-95 [&_.ant-btn-content]:min-w-0'
>
<span className='ml-1 text-[13px] font-semibold truncate'>
{activeItem?.mobileText || activeItem?.text || t('导航')}
</span>
</Button>
</span>
<Button
type='text'
aria-label={t('主导航')}
title={activeItem?.text}
aria-haspopup='menu'
aria-expanded={visible}
icon={<ActionCompass size={16} />}
className='ml-1 px-2 max-w-[9rem] [&_.ant-btn-content]:min-w-0'
>
<span className='ml-1 text-[13px] font-semibold truncate'>
{activeItem?.mobileText || activeItem?.text || t('导航')}
</span>
</Button>
</Dropdown>
);
};