feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -19,9 +19,8 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useState, useContext } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Button } from '@douyinfe/semi-ui';
|
||||
import { IconCreditCard } from '@douyinfe/semi-icons';
|
||||
import { Share2, BookOpen, MonitorDown } from 'lucide-react';
|
||||
import { Button as AntButton, Divider, Tooltip } from 'antd';
|
||||
import { Share2, BookOpen, Download, Wallet } from 'lucide-react';
|
||||
import NewYearButton from './NewYearButton';
|
||||
import NotificationButton from './NotificationButton';
|
||||
import ThemeToggle from './ThemeToggle';
|
||||
@@ -141,72 +140,58 @@ const ActionButtons = ({
|
||||
isActionVisible('theme') ||
|
||||
languageSwitchEnabled;
|
||||
|
||||
// 进入用户区前是否需要分隔线(任一侧有按钮即显示)
|
||||
const hasHeaderActions = hasPrimaryActions || hasUtilityActions;
|
||||
const actionIcon = (Icon) => <Icon size={16} strokeWidth={1.5} aria-hidden />;
|
||||
|
||||
return (
|
||||
<div className='flex items-center shrink-0 gap-0.5 sm:gap-2 md:gap-3'>
|
||||
<div className='ui-header-actions flex items-center shrink-0'>
|
||||
{/* Tutorial Button - 新手教程按钮 (桌面端显示) */}
|
||||
{isLoggedIn && isButtonVisible('tutorial') && (
|
||||
<Link to='/tutorial' className='hidden sm:block'>
|
||||
<Button
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<BookOpen size={15} />}
|
||||
className='group/btn hover:!bg-brand/10 dark:hover:!bg-brand/20 !text-brand-deep dark:!text-brand-from !border !border-brand/30 dark:!border-brand/25 hover:!border-brand/50 !rounded-full !px-3.5 !h-8 !transition-all !duration-200 !shadow-sm hover:!shadow-md hover:!shadow-brand/20 hover:!-translate-y-0.5 active:!translate-y-0'
|
||||
style={{ background: 'var(--semi-color-primary-light-default)' }}
|
||||
>
|
||||
{!isMobile && <span className='font-medium'>{t('新手教程')}</span>}
|
||||
</Button>
|
||||
<AntButton icon={actionIcon(BookOpen)}>
|
||||
{!isMobile && t('新手教程')}
|
||||
</AntButton>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{/* Promotion Button - 推广按钮 (桌面端显示) */}
|
||||
{isLoggedIn && isButtonVisible('pricing') && (
|
||||
<Button
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<Share2 size={15} />}
|
||||
className='hidden sm:!inline-flex hover:!bg-brand/10 dark:hover:!bg-brand/20 !text-brand-deep dark:!text-brand-from !border !border-brand/30 dark:!border-brand/25 hover:!border-brand/50 !rounded-full !px-3.5 !h-8 !transition-all !duration-200 !shadow-sm hover:!shadow-md hover:!shadow-brand/20 hover:!-translate-y-0.5 active:!translate-y-0'
|
||||
style={{ background: 'var(--semi-color-primary-light-default)' }}
|
||||
<AntButton
|
||||
icon={actionIcon(Share2)}
|
||||
className='hidden sm:!inline-flex'
|
||||
onClick={() => setPromotionVisible(true)}
|
||||
>
|
||||
{!isMobile && <span className='font-medium'>{t('推广')}</span>}
|
||||
</Button>
|
||||
{!isMobile && t('推广')}
|
||||
</AntButton>
|
||||
)}
|
||||
|
||||
{/* WeyAi 桌面端下载 - 有 WeyAi 访问权限且下载页已开放时显示 (桌面端显示) */}
|
||||
{showWeyAiDownload && (
|
||||
<Link
|
||||
to='/weyai/download'
|
||||
className='hidden sm:block'
|
||||
aria-label={t('下载 WeyAi 桌面端')}
|
||||
>
|
||||
<Button
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<MonitorDown size={15} />}
|
||||
className='group/btn hover:!bg-brand/10 dark:hover:!bg-brand/20 !text-brand-deep dark:!text-brand-from !border !border-brand/30 dark:!border-brand/25 hover:!border-brand/50 !rounded-full !px-3.5 !h-8 !transition-all !duration-200 !shadow-sm hover:!shadow-md hover:!shadow-brand/20 hover:!-translate-y-0.5 active:!translate-y-0'
|
||||
style={{ background: 'var(--semi-color-primary-light-default)' }}
|
||||
<Tooltip title={t('下载 WeyAi')}>
|
||||
<Link
|
||||
to='/weyai/download'
|
||||
className='hidden sm:block'
|
||||
aria-label={t('下载 WeyAi 桌面端')}
|
||||
>
|
||||
{!isMobile && (
|
||||
<span className='font-medium'>{t('下载 WeyAi')}</span>
|
||||
)}
|
||||
</Button>
|
||||
</Link>
|
||||
<AntButton
|
||||
type='text'
|
||||
className='ui-header-download'
|
||||
icon={actionIcon(Download)}
|
||||
>
|
||||
{!isMobile && t('下载 WeyAi')}
|
||||
</AntButton>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
{/* Recharge Button - 充值按钮 (primary CTA) */}
|
||||
{/* Recharge Button - 充值按钮 */}
|
||||
{isButtonVisible('recharge') && (
|
||||
<Link to='/recharge'>
|
||||
<Button
|
||||
theme='solid'
|
||||
type='primary'
|
||||
icon={<IconCreditCard />}
|
||||
className='!bg-gradient-to-r !from-brand !to-brand-deep dark:!from-brand dark:!to-brand-deep !text-white !border-none !rounded-full !px-3 sm:!px-4 !h-7 sm:!h-8 !font-semibold !transition-all !duration-200 !shadow-md !shadow-brand/30 hover:!shadow-lg hover:!shadow-brand/45 hover:!-translate-y-0.5 active:!translate-y-0 active:!scale-[0.98]'
|
||||
<AntButton
|
||||
icon={actionIcon(Wallet)}
|
||||
aria-label={isMobile ? t('充值') : undefined}
|
||||
>
|
||||
{!isMobile && <span className='font-medium'>{t('充值')}</span>}
|
||||
</Button>
|
||||
{!isMobile && t('充值')}
|
||||
</AntButton>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
@@ -215,15 +200,20 @@ const ActionButtons = ({
|
||||
onClose={() => setPromotionVisible(false)}
|
||||
/>
|
||||
|
||||
{/* Divider */}
|
||||
{/* Divider:原型仅在主操作与工具按钮之间保留一条竖线 */}
|
||||
{hasPrimaryActions && hasUtilityActions && (
|
||||
<div className='hidden md:block w-px h-6 bg-gradient-to-b from-transparent via-gray-300 dark:via-neutral-600 to-transparent mx-1' />
|
||||
<Divider type='vertical' className='ui-header-actions-divider' />
|
||||
)}
|
||||
|
||||
{isActionVisible('newYear') && (
|
||||
<NewYearButton isNewYear={isNewYear} t={t} />
|
||||
)}
|
||||
|
||||
{isActionVisible('theme') && (
|
||||
<ThemeToggle theme={theme} onThemeToggle={onThemeToggle} t={t} />
|
||||
)}
|
||||
|
||||
{/* 系统公告:原型位于主题与语言之间 */}
|
||||
{isActionVisible('notifications') && (
|
||||
<NotificationButton
|
||||
unreadCount={unreadCount}
|
||||
@@ -232,10 +222,6 @@ const ActionButtons = ({
|
||||
/>
|
||||
)}
|
||||
|
||||
{isActionVisible('theme') && (
|
||||
<ThemeToggle theme={theme} onThemeToggle={onThemeToggle} t={t} />
|
||||
)}
|
||||
|
||||
{languageSwitchEnabled && (
|
||||
<LanguageSelector
|
||||
currentLang={currentLang}
|
||||
@@ -244,11 +230,6 @@ const ActionButtons = ({
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Divider before user area(认证页 UserArea 通常为空,不渲染悬空分隔线) */}
|
||||
{hasHeaderActions && !isAuthPage && (
|
||||
<div className='hidden md:block w-px h-6 bg-gradient-to-b from-transparent via-gray-300 dark:via-neutral-600 to-transparent mx-1' />
|
||||
)}
|
||||
|
||||
<UserArea
|
||||
userState={userState}
|
||||
isLoading={isLoading}
|
||||
@@ -257,6 +238,7 @@ const ActionButtons = ({
|
||||
headerNavModules={headerNavModules}
|
||||
rightActions={headerNavModules?.rightActions}
|
||||
sidebarModulesAdmin={sidebarModulesAdmin}
|
||||
isOrgUser={isOrgUser}
|
||||
logout={logout}
|
||||
navigate={navigate}
|
||||
t={t}
|
||||
|
||||
Reference in New Issue
Block a user