feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -18,12 +18,15 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useContext, useMemo, useRef, useState, useEffect } from 'react';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
import { Megaphone } from 'lucide-react';
|
||||
import { Megaphone, X } from 'lucide-react';
|
||||
import { Button } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useMarquee } from '../../hooks/common/useMarquee';
|
||||
|
||||
const Marquee = () => {
|
||||
const { t } = useTranslation();
|
||||
const [statusState] = useContext(StatusContext);
|
||||
const { visible, dismiss } = useMarquee();
|
||||
const marqueeContent = statusState?.status?.marquee_content || '';
|
||||
const containerRef = useRef(null);
|
||||
const measureRef = useRef(null);
|
||||
@@ -80,7 +83,7 @@ const Marquee = () => {
|
||||
};
|
||||
}, [displayText]);
|
||||
|
||||
if (!displayText) return null;
|
||||
if (!displayText || !visible) return null;
|
||||
|
||||
return (
|
||||
<div className='marquee-bar relative w-full overflow-hidden z-[99]'>
|
||||
@@ -90,13 +93,10 @@ const Marquee = () => {
|
||||
<div className='flex items-center h-10 px-5'>
|
||||
{/* 左侧图标 - 固定不动 */}
|
||||
<div className='flex-shrink-0 flex items-center gap-2 mr-4 z-10'>
|
||||
<div
|
||||
className='flex items-center justify-center w-6 h-6 rounded-full bg-white/20 dark:bg-white/10 backdrop-blur-sm'
|
||||
style={{ boxShadow: '0 0 8px rgba(255,255,255,0.2)' }}
|
||||
>
|
||||
<Megaphone size={13} className='text-white drop-shadow-sm' />
|
||||
<div className='marquee-icon flex items-center justify-center w-6 h-6'>
|
||||
<Megaphone size={13} />
|
||||
</div>
|
||||
<span className='text-[13px] font-semibold text-white hidden sm:inline tracking-wider drop-shadow-sm'>
|
||||
<span className='text-[13px] font-semibold hidden sm:inline'>
|
||||
{t('公告')}
|
||||
</span>
|
||||
</div>
|
||||
@@ -106,7 +106,7 @@ const Marquee = () => {
|
||||
{/* 隐藏的测量元素 - 用于获取文本自然宽度,不受动态 padding 影响 */}
|
||||
<span
|
||||
ref={measureRef}
|
||||
className='invisible absolute whitespace-nowrap text-[14px] font-medium tracking-wide'
|
||||
className='marquee-measure invisible absolute whitespace-nowrap text-[14px] font-medium tracking-wide'
|
||||
style={{ top: -9999, left: -9999 }}
|
||||
aria-hidden='true'
|
||||
>
|
||||
@@ -139,6 +139,15 @@ const Marquee = () => {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type='text'
|
||||
size='small'
|
||||
className='marquee-close flex-shrink-0 ml-4 z-10'
|
||||
aria-label={t('关闭')}
|
||||
icon={<X size={14} aria-hidden />}
|
||||
onClick={dismiss}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 底部发光线 */}
|
||||
|
||||
@@ -19,23 +19,24 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useEffect, useState, useContext, useMemo } from 'react';
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Card,
|
||||
Checkbox,
|
||||
Modal,
|
||||
} from '@douyinfe/semi-ui';
|
||||
Segmented,
|
||||
Spin,
|
||||
Tag,
|
||||
theme,
|
||||
} from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API, showError, getRelativeTime } from '../../helpers';
|
||||
import { marked } from 'marked';
|
||||
|
||||
import { StatusContext } from '../../context/Status';
|
||||
import {
|
||||
Bell,
|
||||
Megaphone,
|
||||
Sparkles,
|
||||
X,
|
||||
CalendarClock,
|
||||
Volume2,
|
||||
Clock,
|
||||
ChevronRight,
|
||||
} from 'lucide-react';
|
||||
import { Bell, Volume1 } from 'lucide-react';
|
||||
import './notice-modal.css';
|
||||
|
||||
const EMPTY_ANNOUNCEMENTS = [];
|
||||
|
||||
const NoticeModal = ({
|
||||
visible,
|
||||
@@ -45,14 +46,14 @@ const NoticeModal = ({
|
||||
unreadKeys = [],
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { token } = theme.useToken();
|
||||
const [noticeContent, setNoticeContent] = useState('');
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [activeTab, setActiveTab] = useState(defaultTab);
|
||||
|
||||
const [dismissToday, setDismissToday] = useState(true);
|
||||
const [statusState] = useContext(StatusContext);
|
||||
|
||||
const announcements = statusState?.status?.announcements || [];
|
||||
|
||||
const announcements =
|
||||
statusState?.status?.announcements || EMPTY_ANNOUNCEMENTS;
|
||||
const unreadSet = useMemo(() => new Set(unreadKeys), [unreadKeys]);
|
||||
|
||||
const getKeyForItem = (item) =>
|
||||
@@ -114,321 +115,145 @@ const NoticeModal = ({
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
setActiveTab(defaultTab);
|
||||
setDismissToday(true);
|
||||
}
|
||||
}, [defaultTab, visible]);
|
||||
|
||||
const renderMarkdownNotice = () => {
|
||||
if (loading) {
|
||||
return (
|
||||
<div className='py-20 flex flex-col items-center justify-center'>
|
||||
<div className='relative'>
|
||||
<div className='w-16 h-16 border-4 border-brand/10 dark:border-brand-deep rounded-full' />
|
||||
<div className='absolute inset-0 w-16 h-16 border-4 border-transparent border-t-brand rounded-full animate-spin' />
|
||||
<div
|
||||
className='absolute inset-2 w-12 h-12 border-4 border-transparent border-t-brand-via rounded-full animate-spin'
|
||||
style={{
|
||||
animationDirection: 'reverse',
|
||||
animationDuration: '0.8s',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className='mt-4 text-gray-500 dark:text-gray-400 font-medium'>
|
||||
{t('加载中...')}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!noticeContent) {
|
||||
return (
|
||||
<div className='py-16 flex flex-col items-center justify-center'>
|
||||
<div className='relative'>
|
||||
<div className='w-24 h-24 bg-gradient-to-br from-brand-from/5 to-brand-to/5 dark:from-brand-from/30 dark:to-brand-to/30 rounded-3xl flex items-center justify-center shadow-inner'>
|
||||
<Bell
|
||||
size={40}
|
||||
className='text-brand-from dark:text-brand-deep'
|
||||
/>
|
||||
</div>
|
||||
<div className='absolute -bottom-1 -right-1 w-8 h-8 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-xl flex items-center justify-center shadow-lg'>
|
||||
<Sparkles size={16} className='text-white' />
|
||||
</div>
|
||||
</div>
|
||||
<span className='mt-5 text-gray-700 dark:text-gray-300 text-lg font-semibold'>
|
||||
{t('暂无公告')}
|
||||
</span>
|
||||
<span className='text-gray-400 dark:text-gray-500 text-sm mt-1'>
|
||||
{t('一切正常,稍后再来看看吧')}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='notice-content-scroll max-h-[50vh] overflow-y-auto pr-2 custom-scrollbar'>
|
||||
<div className='p-4 bg-gray-50/80 dark:bg-gray-800/60 rounded-xl border border-gray-200/60 dark:border-gray-700/40'>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: noticeContent }}
|
||||
className='prose prose-sm dark:prose-invert max-w-none
|
||||
prose-headings:text-gray-900 dark:prose-headings:text-gray-50 prose-headings:font-bold
|
||||
prose-h1:text-xl prose-h2:text-lg prose-h3:text-base
|
||||
prose-p:text-gray-600 dark:prose-p:text-gray-300 prose-p:leading-relaxed
|
||||
prose-a:text-brand-deep dark:prose-a:text-brand-from prose-a:no-underline hover:prose-a:underline prose-a:font-medium
|
||||
prose-strong:text-gray-800 dark:prose-strong:text-gray-100
|
||||
prose-code:bg-gray-100 dark:prose-code:bg-gray-800 prose-code:text-gray-700 dark:prose-code:text-gray-300 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-xs
|
||||
prose-pre:bg-gray-900 dark:prose-pre:bg-gray-950 prose-pre:text-gray-100 prose-pre:rounded-xl
|
||||
prose-img:rounded-xl
|
||||
prose-ul:space-y-1 prose-ol:space-y-1
|
||||
prose-li:text-gray-600 dark:prose-li:text-gray-300'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const getTypeConfig = (type) => {
|
||||
const configs = {
|
||||
success: {
|
||||
bg: 'bg-emerald-50 dark:bg-emerald-900/20',
|
||||
border: 'border-emerald-200 dark:border-emerald-800',
|
||||
dot: 'bg-emerald-500',
|
||||
tag: 'green',
|
||||
},
|
||||
warning: {
|
||||
bg: 'bg-amber-50 dark:bg-amber-900/20',
|
||||
border: 'border-amber-200 dark:border-amber-800',
|
||||
dot: 'bg-amber-500',
|
||||
tag: 'orange',
|
||||
},
|
||||
error: {
|
||||
bg: 'bg-red-50 dark:bg-red-900/20',
|
||||
border: 'border-red-200 dark:border-red-800',
|
||||
dot: 'bg-red-500',
|
||||
tag: 'red',
|
||||
},
|
||||
ongoing: {
|
||||
bg: 'bg-blue-50 dark:bg-blue-900/20',
|
||||
border: 'border-blue-200 dark:border-blue-800',
|
||||
dot: 'bg-blue-500',
|
||||
tag: 'blue',
|
||||
},
|
||||
default: {
|
||||
bg: 'bg-gray-50 dark:bg-gray-800/50',
|
||||
border: 'border-gray-200 dark:border-gray-700',
|
||||
dot: 'bg-brand',
|
||||
tag: 'violet',
|
||||
},
|
||||
};
|
||||
return configs[type] || configs.default;
|
||||
};
|
||||
|
||||
const renderAnnouncementTimeline = () => {
|
||||
if (processedAnnouncements.length === 0) {
|
||||
return (
|
||||
<div className='py-16 flex flex-col items-center justify-center'>
|
||||
<div className='relative'>
|
||||
<div className='w-24 h-24 bg-gradient-to-br from-emerald-50 to-teal-50 dark:from-emerald-900/30 dark:to-teal-900/30 rounded-3xl flex items-center justify-center shadow-inner'>
|
||||
<Megaphone
|
||||
size={40}
|
||||
className='text-emerald-300 dark:text-emerald-600'
|
||||
/>
|
||||
</div>
|
||||
<div className='absolute -bottom-1 -right-1 w-8 h-8 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-xl flex items-center justify-center shadow-lg'>
|
||||
<Sparkles size={16} className='text-white' />
|
||||
</div>
|
||||
</div>
|
||||
<span className='mt-5 text-gray-700 dark:text-gray-300 text-lg font-semibold'>
|
||||
{t('暂无系统公告')}
|
||||
</span>
|
||||
<span className='text-gray-400 dark:text-gray-500 text-sm mt-1'>
|
||||
{t('一切正常运行中')}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='max-h-[50vh] overflow-y-auto pr-2 custom-scrollbar space-y-3'>
|
||||
{processedAnnouncements.map((item, idx) => {
|
||||
const htmlContent = marked.parse(item.content || '');
|
||||
const htmlExtra = item.extra ? marked.parse(item.extra) : '';
|
||||
const typeConfig = getTypeConfig(item.type);
|
||||
|
||||
return (
|
||||
<div
|
||||
key={idx}
|
||||
className={`group relative rounded-xl border ${typeConfig.bg} ${typeConfig.border} p-4 transition-all duration-200 hover:shadow-md ${item.isUnread ? 'ring-1 ring-brand/30 ring-offset-1 ring-offset-white dark:ring-offset-gray-900' : ''}`}
|
||||
>
|
||||
{/* 未读标记 */}
|
||||
{item.isUnread && (
|
||||
<div className='absolute -top-1.5 -right-1.5'>
|
||||
<span className='relative flex h-4 w-4'>
|
||||
<span className='animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-from opacity-60'></span>
|
||||
<span className='relative inline-flex rounded-full h-4 w-4 bg-gradient-to-r from-brand-from to-brand-to items-center justify-center'>
|
||||
<span className='text-[8px] text-white font-bold'>N</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 时间和类型标签 */}
|
||||
<div className='flex items-center justify-between mb-2.5'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div
|
||||
className={`w-2 h-2 rounded-full ${typeConfig.dot} flex-shrink-0`}
|
||||
/>
|
||||
<div className='flex items-center gap-1.5 text-xs'>
|
||||
<span className='font-medium text-gray-700 dark:text-gray-300'>
|
||||
{item.relative}
|
||||
</span>
|
||||
<span className='text-gray-300 dark:text-gray-600'>·</span>
|
||||
<span className='text-gray-400 dark:text-gray-500 flex items-center gap-1'>
|
||||
<CalendarClock size={10} />
|
||||
{item.time}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{item.isUnread && (
|
||||
<span className='px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider rounded-md bg-brand/10 dark:bg-brand/20 text-brand-deep dark:text-brand-from'>
|
||||
NEW
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 公告内容 */}
|
||||
<div
|
||||
className='prose prose-sm dark:prose-invert max-w-none
|
||||
prose-p:text-gray-600 dark:prose-p:text-gray-300 prose-p:my-1 prose-p:leading-relaxed
|
||||
prose-a:text-brand-deep dark:prose-a:text-brand-from prose-a:font-medium prose-a:no-underline hover:prose-a:underline
|
||||
prose-strong:text-gray-800 dark:prose-strong:text-gray-100
|
||||
prose-code:bg-gray-100 dark:prose-code:bg-gray-800 prose-code:text-gray-700 dark:prose-code:text-gray-300 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-xs'
|
||||
dangerouslySetInnerHTML={{ __html: htmlContent }}
|
||||
/>
|
||||
|
||||
{/* 额外信息 */}
|
||||
{item.extra && (
|
||||
<div
|
||||
className='mt-2.5 pt-2.5 border-t border-gray-200/60 dark:border-gray-700/40 text-xs text-gray-500 dark:text-gray-400'
|
||||
dangerouslySetInnerHTML={{ __html: htmlExtra }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
const unreadCount = processedAnnouncements.filter(
|
||||
(item) => item.isUnread,
|
||||
).length;
|
||||
const typeColors = {
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
ongoing: 'processing',
|
||||
default: 'default',
|
||||
};
|
||||
|
||||
const renderBody = () => {
|
||||
if (activeTab === 'inApp') {
|
||||
return renderMarkdownNotice();
|
||||
if (loading) {
|
||||
return (
|
||||
<div className='nm-empty'>
|
||||
<Spin tip={t('加载中...')}>
|
||||
<div className='nm-spin-placeholder' />
|
||||
</Spin>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (!noticeContent) {
|
||||
return <div className='nm-empty'>{t('暂无公告')}</div>;
|
||||
}
|
||||
return (
|
||||
<div className='nm-notice-scroll' tabIndex={0} aria-label={t('通知')}>
|
||||
<div
|
||||
className='nm-markdown'
|
||||
dangerouslySetInnerHTML={{ __html: noticeContent }}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return renderAnnouncementTimeline();
|
||||
if (processedAnnouncements.length === 0) {
|
||||
return <div className='nm-empty'>{t('暂无系统公告')}</div>;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className='nm-announcement-scroll'
|
||||
tabIndex={0}
|
||||
aria-label={t('系统公告')}
|
||||
>
|
||||
{processedAnnouncements.map((item, idx) => (
|
||||
<Card key={idx} size='small'>
|
||||
<div className='nm-announcement-meta'>
|
||||
<span>
|
||||
<Badge status={typeColors[item.type] || 'default'} />{' '}
|
||||
{item.relative} · {item.time}
|
||||
</span>
|
||||
{item.isUnread && (
|
||||
<Tag color={typeColors[item.type] || 'default'}>NEW</Tag>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
className='nm-markdown'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked.parse(item.content || ''),
|
||||
}}
|
||||
/>
|
||||
{item.extra && (
|
||||
<div
|
||||
className='nm-announcement-extra nm-markdown'
|
||||
dangerouslySetInnerHTML={{ __html: marked.parse(item.extra) }}
|
||||
/>
|
||||
)}
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={null}
|
||||
visible={visible}
|
||||
title={t('系统公告')}
|
||||
open={visible}
|
||||
onCancel={onClose}
|
||||
footer={null}
|
||||
closable={false}
|
||||
size={isMobile ? 'full-width' : 'large'}
|
||||
className='notice-modal-enhanced'
|
||||
bodyStyle={{ padding: 0 }}
|
||||
width={isMobile ? 'calc(100% - 32px)' : 860}
|
||||
className='notice-modal'
|
||||
rootClassName='notice-modal-root'
|
||||
styles={{
|
||||
mask: {
|
||||
background: `color-mix(in srgb, ${token.colorBgMask} 70%, transparent)`,
|
||||
},
|
||||
}}
|
||||
style={{
|
||||
'--nm-surface': token.colorBgContainer,
|
||||
'--nm-text': token.colorText,
|
||||
'--nm-muted': token.colorTextSecondary,
|
||||
'--nm-border': token.colorBorderSecondary,
|
||||
'--nm-fill': token.colorFillQuaternary,
|
||||
'--nm-tab-bg': token.colorBgLayout,
|
||||
'--nm-primary': token.colorPrimary,
|
||||
}}
|
||||
maskClosable={true}
|
||||
>
|
||||
<div className='relative overflow-hidden'>
|
||||
{/* 背景装饰 */}
|
||||
<div className='absolute inset-0 pointer-events-none overflow-hidden'>
|
||||
<div className='absolute -top-24 -right-24 w-48 h-48 bg-gradient-to-br from-brand-from/[0.08] to-brand-to/[0.08] dark:from-brand-from/15 dark:to-brand-to/15 rounded-full blur-3xl' />
|
||||
<div className='absolute -bottom-24 -left-24 w-48 h-48 bg-gradient-to-br from-pink-500/[0.08] to-rose-500/[0.08] dark:from-pink-500/15 dark:to-rose-500/15 rounded-full blur-3xl' />
|
||||
</div>
|
||||
|
||||
{/* 头部区域 */}
|
||||
<div className='relative px-6 pt-6 pb-4'>
|
||||
{/* 关闭按钮 */}
|
||||
<button
|
||||
onClick={onClose}
|
||||
className='absolute top-4 right-4 p-2 rounded-full bg-gray-100/80 dark:bg-gray-700/80 hover:bg-gray-200 dark:hover:bg-gray-600 transition-all duration-200 z-10 backdrop-blur-sm hover:scale-105 active:scale-95'
|
||||
aria-label='Close'
|
||||
footer={
|
||||
<div className='nm-footer'>
|
||||
<Checkbox
|
||||
checked={dismissToday}
|
||||
onChange={(event) => setDismissToday(event.target.checked)}
|
||||
>
|
||||
<X size={16} className='text-gray-500 dark:text-gray-400' />
|
||||
</button>
|
||||
|
||||
{/* 标题 */}
|
||||
<div className='flex items-center gap-3 mb-5'>
|
||||
<div className='relative'>
|
||||
<div className='p-2.5 bg-gradient-to-br from-brand-from to-brand-to rounded-xl shadow-lg shadow-brand/20 dark:shadow-brand/30'>
|
||||
<Volume2 size={22} className='text-white' />
|
||||
</div>
|
||||
<div className='absolute -top-1 -right-1 w-2.5 h-2.5 bg-rose-500 rounded-full animate-pulse ring-2 ring-white dark:ring-gray-900' />
|
||||
</div>
|
||||
<div>
|
||||
<h2 className='text-lg font-bold text-gray-900 dark:text-gray-50 flex items-center gap-2'>
|
||||
{t('今日不再提示')}
|
||||
</Checkbox>
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={dismissToday ? handleCloseTodayNotice : onClose}
|
||||
>
|
||||
{t('我知道了')}
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Segmented
|
||||
block
|
||||
value={activeTab}
|
||||
onChange={setActiveTab}
|
||||
options={[
|
||||
{
|
||||
value: 'inApp',
|
||||
label: t('通知'),
|
||||
icon: <Bell size={14} strokeWidth={1.5} aria-hidden />,
|
||||
},
|
||||
{
|
||||
value: 'system',
|
||||
label: (
|
||||
<span className='nm-system-label'>
|
||||
{t('系统公告')}
|
||||
<Sparkles size={14} className='text-amber-500' />
|
||||
</h2>
|
||||
<p className='text-xs text-gray-500 dark:text-gray-400 mt-0.5'>
|
||||
{t('了解最新动态和通知')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Tab 切换器 */}
|
||||
<div className='flex gap-1.5 p-1 bg-gray-100/80 dark:bg-gray-800/80 rounded-xl backdrop-blur-sm'>
|
||||
<button
|
||||
onClick={() => setActiveTab('inApp')}
|
||||
className={`flex-1 flex items-center justify-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 ${
|
||||
activeTab === 'inApp'
|
||||
? 'bg-white dark:bg-gray-700 text-brand-deep dark:text-brand-from shadow-sm ring-1 ring-black/5 dark:ring-white/10'
|
||||
: 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-white/50 dark:hover:bg-gray-700/50'
|
||||
}`}
|
||||
>
|
||||
<Bell size={15} />
|
||||
{t('通知')}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab('system')}
|
||||
className={`flex-1 flex items-center justify-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 ${
|
||||
activeTab === 'system'
|
||||
? 'bg-white dark:bg-gray-700 text-brand-deep dark:text-brand-from shadow-sm ring-1 ring-black/5 dark:ring-white/10'
|
||||
: 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-white/50 dark:hover:bg-gray-700/50'
|
||||
}`}
|
||||
>
|
||||
<Megaphone size={15} />
|
||||
{t('系统公告')}
|
||||
{processedAnnouncements.filter((a) => a.isUnread).length > 0 && (
|
||||
<span className='px-1.5 py-0.5 text-[10px] font-semibold bg-rose-500 text-white rounded-full min-w-[18px] text-center leading-tight'>
|
||||
{processedAnnouncements.filter((a) => a.isUnread).length}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 内容区域 */}
|
||||
<div className='relative px-6 pb-2'>{renderBody()}</div>
|
||||
|
||||
{/* 底部按钮区域 */}
|
||||
<div className='relative px-6 py-4 border-t border-gray-200/60 dark:border-gray-700/60'>
|
||||
<div className='flex items-center justify-between'>
|
||||
<button
|
||||
onClick={handleCloseTodayNotice}
|
||||
className='flex items-center gap-1.5 px-3 py-2 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition-colors rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800'
|
||||
>
|
||||
<Clock size={13} />
|
||||
{t('今日不再提示')}
|
||||
</button>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className='flex items-center gap-1.5 px-5 py-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white text-sm font-medium rounded-xl shadow-md shadow-brand/20 dark:shadow-brand/30 transition-all duration-200 hover:shadow-lg hover:shadow-brand/25 hover:-translate-y-0.5 active:translate-y-0'
|
||||
>
|
||||
{t('我知道了')}
|
||||
<ChevronRight size={14} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Badge count={unreadCount} size='small' />
|
||||
</span>
|
||||
),
|
||||
icon: <Volume1 size={14} strokeWidth={1.5} aria-hidden />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<div className='nm-body'>{renderBody()}</div>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -17,9 +17,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { Layout } from '@douyinfe/semi-ui';
|
||||
import { Layout } from '@/components/ui';
|
||||
import App from '../../App';
|
||||
import { ToastContainer } from 'react-toastify';
|
||||
import React, {
|
||||
useContext,
|
||||
useEffect,
|
||||
@@ -58,6 +57,7 @@ const CustomerServiceFloat = lazy(() => import('../customer-service'));
|
||||
|
||||
// 跑马灯公告组件
|
||||
import Marquee from './Marquee';
|
||||
import { useMarquee } from '../../hooks/common/useMarquee';
|
||||
|
||||
const { Sider, Content, Header } = Layout;
|
||||
|
||||
@@ -78,7 +78,7 @@ const printConsoleWelcome = (status) => {
|
||||
|
||||
const PageLayout = () => {
|
||||
const [userState, userDispatch] = useContext(UserContext);
|
||||
const [statusState, statusDispatch] = useContext(StatusContext);
|
||||
const [, statusDispatch] = useContext(StatusContext);
|
||||
const isMobile = useIsMobile();
|
||||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||
const { i18n } = useTranslation();
|
||||
@@ -127,19 +127,17 @@ const PageLayout = () => {
|
||||
const disableOuterScroll =
|
||||
isExperienceCenter || isUserCenter || isHomePage || isOrgPage;
|
||||
|
||||
// 需要显示可见滚动条的页面(覆盖 semi-layout 默认隐藏滚动条的行为)。
|
||||
// 需要显示可见滚动条的页面(覆盖 ant-layout 默认隐藏滚动条的行为)。
|
||||
// 认证页也纳入:内容确实超出视口时(小屏/长表单)用主题色滚动条明示,而不是隐形滚动导致卡片"莫名移动"。
|
||||
const isKeyManagement = location.pathname === '/key-management';
|
||||
const isKeyManagement = location.pathname === '/user-center/key-management';
|
||||
const showVisibleScrollbar = isKeyManagement || isAuthPage;
|
||||
|
||||
// 跑马灯公告是否存在(用于动态计算头部总高度)。
|
||||
// 认证页(登录/注册/企业登录/企业注册)不展示:用户尚未进入平台,公告是面向平台内用户的信息。
|
||||
const hasMarquee =
|
||||
!hideHeader &&
|
||||
!isAuthPage &&
|
||||
!!statusState?.status?.marquee_content?.trim();
|
||||
const marqueeHeight = hasMarquee ? 40 : 0; // h-10 = 40px
|
||||
const headerBarHeight = isMobile ? 56 : 64; // h-14(56px) on mobile, h-16(64px) on desktop
|
||||
const { visible: marqueeVisible } = useMarquee();
|
||||
const hasMarquee = !hideHeader && !isAuthPage && marqueeVisible;
|
||||
const marqueeHeight = hasMarquee ? 35 : 0;
|
||||
const headerBarHeight = isMobile ? 56 : 72;
|
||||
const totalHeaderHeight = headerBarHeight + marqueeHeight;
|
||||
|
||||
// 滚动容器引用
|
||||
@@ -344,6 +342,13 @@ const PageLayout = () => {
|
||||
>
|
||||
{!hideHeader && (
|
||||
<Header
|
||||
className={
|
||||
isAuthPage
|
||||
? ['/org/login', '/login'].includes(location.pathname)
|
||||
? 'login-layout-header'
|
||||
: 'auth-layout-header'
|
||||
: undefined
|
||||
}
|
||||
style={{
|
||||
padding: 0,
|
||||
height: 'auto',
|
||||
@@ -460,7 +465,6 @@ const PageLayout = () => {
|
||||
</Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
<ToastContainer />
|
||||
<Suspense fallback={null}>
|
||||
<CustomerServiceFloat />
|
||||
</Suspense>
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
import SkeletonWrapper from './components/SkeletonWrapper';
|
||||
import { CLOUD_BRAIN_UI_ENABLED } from '../../config/cloudBrainUi';
|
||||
|
||||
import { Nav, Divider, Button } from '@douyinfe/semi-ui';
|
||||
import { Nav, Divider, Button } from '@/components/ui';
|
||||
|
||||
const routerMap = {
|
||||
home: '/',
|
||||
@@ -457,7 +457,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
|
||||
}, [persistedCollapsed, forceExpanded]);
|
||||
|
||||
// 选中高亮颜色(统一)
|
||||
const SELECTED_COLOR = 'var(--semi-color-primary)';
|
||||
const SELECTED_COLOR = 'var(--ui-color-primary)';
|
||||
|
||||
// 渲染自定义菜单项
|
||||
const renderNavItem = (item) => {
|
||||
@@ -546,7 +546,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
|
||||
width: forceExpanded
|
||||
? 'var(--sidebar-width)'
|
||||
: 'var(--sidebar-current-width)',
|
||||
background: 'var(--semi-color-bg-0)',
|
||||
background: 'var(--ui-color-bg-0)',
|
||||
}}
|
||||
>
|
||||
<SkeletonWrapper
|
||||
@@ -664,7 +664,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
|
||||
<ChevronLeft
|
||||
size={16}
|
||||
strokeWidth={2.5}
|
||||
color='var(--semi-color-text-2)'
|
||||
color='var(--ui-color-text-2)'
|
||||
style={{
|
||||
transform: collapsed ? 'rotate(180deg)' : 'rotate(0deg)',
|
||||
}}
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Skeleton } from '@douyinfe/semi-ui';
|
||||
import { Skeleton } from '@/components/ui';
|
||||
|
||||
const SkeletonWrapper = ({
|
||||
loading = false,
|
||||
@@ -64,7 +64,7 @@ const SkeletonWrapper = ({
|
||||
const renderUserAreaSkeleton = () => {
|
||||
return (
|
||||
<div
|
||||
className={`flex items-center p-1 rounded-full bg-semi-color-fill-0 dark:bg-semi-color-fill-1 ${className}`}
|
||||
className={`flex items-center p-1 rounded-full bg-ui-color-fill-0 dark:bg-ui-color-fill-1 ${className}`}
|
||||
>
|
||||
<Skeleton
|
||||
loading={true}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Typography, Tag } from '@douyinfe/semi-ui';
|
||||
import { Tag } from '@/components/ui';
|
||||
import SkeletonWrapper from '../components/SkeletonWrapper';
|
||||
|
||||
const HeaderLogo = ({
|
||||
@@ -38,41 +38,34 @@ const HeaderLogo = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<Link to='/' className='group flex items-center gap-2'>
|
||||
<div className='relative w-8 h-8 md:w-8 md:h-8'>
|
||||
<Link to='/' className='ui-header-logo group flex items-center'>
|
||||
<div className='ui-header-logo-mark relative'>
|
||||
<SkeletonWrapper loading={isLoading || !logoLoaded} type='image' />
|
||||
<img
|
||||
src={logo}
|
||||
alt='logo'
|
||||
className={`absolute inset-0 w-full h-full transition-all duration-200 group-hover:scale-110 rounded-full ${!isLoading && logoLoaded ? 'opacity-100' : 'opacity-0'}`}
|
||||
className={`absolute inset-0 w-full h-full object-contain ${!isLoading && logoLoaded ? 'opacity-100' : 'opacity-0'}`}
|
||||
/>
|
||||
</div>
|
||||
<div className='hidden md:flex items-center gap-2'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<SkeletonWrapper
|
||||
loading={isLoading}
|
||||
type='title'
|
||||
width={120}
|
||||
height={24}
|
||||
<div className='hidden md:flex items-center gap-2 min-w-0'>
|
||||
<SkeletonWrapper
|
||||
loading={isLoading}
|
||||
type='title'
|
||||
width={120}
|
||||
height={24}
|
||||
>
|
||||
<span className='ui-header-brand-name'>{systemName}</span>
|
||||
</SkeletonWrapper>
|
||||
{(isSelfUseMode || isDemoSiteMode) && !isLoading && (
|
||||
<Tag
|
||||
color={isSelfUseMode ? 'purple' : 'blue'}
|
||||
className='text-xs px-1.5 py-0.5 rounded whitespace-nowrap shadow-sm'
|
||||
size='small'
|
||||
shape='circle'
|
||||
>
|
||||
<Typography.Title
|
||||
heading={4}
|
||||
className='!text-lg !font-semibold !mb-0'
|
||||
>
|
||||
{systemName}
|
||||
</Typography.Title>
|
||||
</SkeletonWrapper>
|
||||
{(isSelfUseMode || isDemoSiteMode) && !isLoading && (
|
||||
<Tag
|
||||
color={isSelfUseMode ? 'purple' : 'blue'}
|
||||
className='text-xs px-1.5 py-0.5 rounded whitespace-nowrap shadow-sm'
|
||||
size='small'
|
||||
shape='circle'
|
||||
>
|
||||
{isSelfUseMode ? t('自用模式') : t('演示站点')}
|
||||
</Tag>
|
||||
)}
|
||||
</div>
|
||||
{isSelfUseMode ? t('自用模式') : t('演示站点')}
|
||||
</Tag>
|
||||
)}
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
|
||||
@@ -18,10 +18,10 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Button, Dropdown } from '@douyinfe/semi-ui';
|
||||
import { Button as AntButton } from 'antd';
|
||||
import { Dropdown } from '@/components/ui';
|
||||
import { Globe } from 'lucide-react';
|
||||
import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2';
|
||||
import { useActualTheme } from '../../../context/Theme';
|
||||
import { normalizeLanguage } from '../../../i18n/language';
|
||||
import { orderEnabledLanguages } from '../../../i18n/catalog';
|
||||
import {
|
||||
@@ -36,10 +36,6 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
|
||||
// i18n.language 可能带地区码(如 zh-CN / en-US),高亮判断先归一化;
|
||||
// 繁体靠地区码区分,不能简单取主语言
|
||||
const lang = normalizeLanguage(currentLang);
|
||||
// 与 ThemeToggle 同规范:图标颜色随实际主题动态取色(Semi 暗色由
|
||||
// body[theme-mode] 驱动,Tailwind dark: 类在此不可靠),菜单样式走
|
||||
// semi-color token 天然亮暗自适应
|
||||
const actualTheme = useActualTheme();
|
||||
|
||||
// 首访时后台判定可能晚于顶栏首次渲染:结果写入缓存后重新读取启用语言,
|
||||
// 避免列出后台已停用的语言
|
||||
@@ -54,8 +50,8 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
|
||||
const getItemClassName = (isSelected) =>
|
||||
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm ${
|
||||
isSelected
|
||||
? '!bg-semi-color-primary-light-default !font-semibold'
|
||||
: 'hover:!bg-semi-color-fill-1'
|
||||
? '!bg-ui-color-primary-light-default !font-semibold'
|
||||
: 'hover:!bg-ui-color-fill-1'
|
||||
}`;
|
||||
|
||||
// 展示哪些语言、按什么顺序由后台「语言与地区」配置决定(经 /api/i18n/locale 缓存下发)
|
||||
@@ -82,21 +78,12 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
|
||||
</Dropdown.Menu>
|
||||
}
|
||||
>
|
||||
<span className='inline-flex'>
|
||||
<Button
|
||||
icon={<Globe size={20} />}
|
||||
aria-label={t('common.changeLanguage')}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
className='!w-8 !h-8 sm:!w-9 sm:!h-9 !flex !items-center !justify-center hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !rounded-full !transition-all !duration-200 hover:!scale-[1.08] active:!scale-95'
|
||||
style={{
|
||||
color:
|
||||
actualTheme === 'dark'
|
||||
? 'rgba(243,244,246,0.9)'
|
||||
: 'rgba(75,85,99,1)',
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
<AntButton
|
||||
type='text'
|
||||
icon={<Globe size={16} strokeWidth={1.5} aria-hidden />}
|
||||
aria-label={t('common.changeLanguage')}
|
||||
className='ui-header-icon-action'
|
||||
/>
|
||||
</Dropdown>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -18,8 +18,8 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Button } from '@douyinfe/semi-ui';
|
||||
import { IconClose, IconMenu } from '@douyinfe/semi-icons';
|
||||
import { Button } from '@/components/ui';
|
||||
import { IconClose, IconMenu } from '@/components/ui/icons';
|
||||
|
||||
const MobileMenuButton = ({
|
||||
isConsoleRoute,
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { Button, Dropdown } from '@douyinfe/semi-ui';
|
||||
import { Button, Dropdown } from '@/components/ui';
|
||||
import { Compass, ExternalLink } from 'lucide-react';
|
||||
|
||||
/**
|
||||
@@ -141,7 +141,7 @@ const MobileNavMenu = ({ mainNavLinks, userState, t }) => {
|
||||
aria-haspopup='menu'
|
||||
aria-expanded={visible}
|
||||
icon={<Compass 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 [&_.semi-button-content]:min-w-0'
|
||||
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 ? activeItem.text : t('导航')}
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { Dropdown } from '@douyinfe/semi-ui';
|
||||
import { Dropdown } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import SkeletonWrapper from '../components/SkeletonWrapper';
|
||||
|
||||
@@ -29,11 +29,10 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
|
||||
const renderNavLinks = () => {
|
||||
const baseClasses =
|
||||
'nav-item-enhanced flex-shrink-0 flex items-center gap-1.5 font-semibold rounded-xl transition-all duration-300 ease-out relative overflow-hidden group';
|
||||
'ui-header-nav-item flex-shrink-0 flex items-center gap-1.5 font-medium relative';
|
||||
const defaultClasses = 'text-gray-600 dark:text-neutral-300';
|
||||
const hoverClasses = 'hover:text-brand-deep dark:hover:text-brand-from';
|
||||
const activeClasses =
|
||||
'text-brand-deep dark:text-brand-from bg-brand/5 dark:bg-brand-deep/30';
|
||||
const activeClasses = 'text-brand-deep dark:text-brand-from';
|
||||
const spacingClasses = isMobile ? 'px-2 py-1 text-sm' : 'px-4 py-2';
|
||||
|
||||
// Match on full path segments so /market doesn't light up on /market-detail
|
||||
@@ -65,11 +64,6 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
isActive = isPathActive(link.activePrefix || targetPath);
|
||||
}
|
||||
|
||||
// Hover background effect component
|
||||
const hoverBg = (
|
||||
<span className='absolute inset-0 bg-gradient-to-r from-brand-from/10 via-brand-via/5 to-brand-to/10 dark:from-brand-from/40 dark:via-brand-via/30 dark:to-brand-to/40 opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-xl' />
|
||||
);
|
||||
|
||||
const finalClasses = `${baseClasses} ${spacingClasses} ${isActive ? `nav-item-active ${activeClasses}` : `${defaultClasses} ${hoverClasses}`}`;
|
||||
|
||||
if (link.items && link.items.length > 0) {
|
||||
@@ -79,12 +73,9 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
trigger={'hover'}
|
||||
position={'bottomLeft'}
|
||||
render={
|
||||
<Dropdown.Menu className='!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'>
|
||||
<Dropdown.Menu>
|
||||
{link.items.map((subItem) => (
|
||||
<Dropdown.Item
|
||||
key={subItem.itemKey}
|
||||
className='!rounded-lg !mx-1 !my-0.5 hover:!bg-brand/5 dark:hover:!bg-brand-deep/30 transition-colors'
|
||||
>
|
||||
<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'
|
||||
@@ -98,7 +89,6 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
}
|
||||
>
|
||||
<div className={`${finalClasses} cursor-pointer`}>
|
||||
{hoverBg}
|
||||
{linkContent}
|
||||
{/* Dropdown arrow */}
|
||||
<svg
|
||||
@@ -128,7 +118,6 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
rel='noopener noreferrer'
|
||||
className={`${baseClasses} ${spacingClasses} ${defaultClasses} ${hoverClasses}`}
|
||||
>
|
||||
{hoverBg}
|
||||
{linkContent}
|
||||
{/* External link icon */}
|
||||
<svg
|
||||
@@ -155,7 +144,6 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
className={finalClasses}
|
||||
aria-current={isActive ? 'page' : undefined}
|
||||
>
|
||||
{hoverBg}
|
||||
{linkContent}
|
||||
</Link>
|
||||
);
|
||||
@@ -165,7 +153,7 @@ const Navigation = ({ mainNavLinks, isMobile, isLoading, userState }) => {
|
||||
return (
|
||||
<nav
|
||||
aria-label={t('主导航')}
|
||||
className='flex flex-1 items-center gap-1 lg:gap-2 mx-1 sm:mx-3 md:mx-6 overflow-x-auto whitespace-nowrap scrollbar-hide min-w-0'
|
||||
className='ui-header-navigation flex flex-1 items-center gap-1 lg:gap-2 mx-1 sm:mx-3 md:mx-6 overflow-x-auto whitespace-nowrap scrollbar-hide min-w-0'
|
||||
>
|
||||
<SkeletonWrapper
|
||||
loading={isLoading}
|
||||
|
||||
@@ -18,7 +18,8 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Button, Dropdown } from '@douyinfe/semi-ui';
|
||||
import { Button as AntButton } from 'antd';
|
||||
import { Dropdown } from '@/components/ui';
|
||||
import fireworks from 'react-fireworks';
|
||||
|
||||
const NewYearButton = ({ isNewYear, t }) => {
|
||||
@@ -38,22 +39,21 @@ const NewYearButton = ({ isNewYear, t }) => {
|
||||
<Dropdown
|
||||
position='bottomRight'
|
||||
render={
|
||||
<Dropdown.Menu className='!bg-semi-color-bg-overlay !border-semi-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600'>
|
||||
<Dropdown.Menu className='!bg-ui-color-bg-overlay !border-ui-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600'>
|
||||
<Dropdown.Item
|
||||
onClick={handleNewYearClick}
|
||||
className='!text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-gray-600'
|
||||
className='!text-ui-color-text-0 hover:!bg-ui-color-fill-1 dark:!text-gray-200 dark:hover:!bg-gray-600'
|
||||
>
|
||||
{t('新年快乐')} 🎉
|
||||
</Dropdown.Item>
|
||||
</Dropdown.Menu>
|
||||
}
|
||||
>
|
||||
<Button
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
<AntButton
|
||||
type='text'
|
||||
icon={<span className='text-xl'>🎉</span>}
|
||||
aria-label={t('新年快乐')}
|
||||
className='!w-8 !h-8 sm:!w-9 sm:!h-9 !flex !items-center !justify-center !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 !rounded-full !transition-all !duration-200 hover:!scale-[1.08] active:!scale-95'
|
||||
className='ui-header-icon-action'
|
||||
/>
|
||||
</Dropdown>
|
||||
);
|
||||
|
||||
@@ -18,64 +18,23 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Button, Badge } from '@douyinfe/semi-ui';
|
||||
import { useActualTheme } from '../../../context/Theme';
|
||||
import { Badge, Button, Tooltip } from 'antd';
|
||||
import { Volume1 } from 'lucide-react';
|
||||
|
||||
// 自定义通知图标 — 圆角方形气泡 + 圆点指示
|
||||
const NoticeIcon = ({ size = 19, color = 'currentColor' }) => (
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox='0 0 24 24'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<rect
|
||||
x='3'
|
||||
y='4'
|
||||
width='18'
|
||||
height='14'
|
||||
rx='4'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
/>
|
||||
<circle cx='8.5' cy='11' r='1.25' fill={color} />
|
||||
<circle cx='12' cy='11' r='1.25' fill={color} />
|
||||
<circle cx='15.5' cy='11' r='1.25' fill={color} />
|
||||
<path
|
||||
d='M8 18l2.5-3h3L16 18'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
strokeLinejoin='round'
|
||||
/>
|
||||
</svg>
|
||||
// 系统公告入口:34px text 按钮、16px 喇叭图标。
|
||||
// 显隐(rightActions.notifications)、点击(打开 NoticeModal)与未读数均沿用原逻辑。
|
||||
const NotificationButton = ({ unreadCount, onNoticeOpen, t }) => (
|
||||
<Tooltip title={t('系统公告')}>
|
||||
<Badge count={unreadCount} overflowCount={99} size='small'>
|
||||
<Button
|
||||
type='text'
|
||||
className='ui-header-icon-action'
|
||||
aria-label={t('系统公告')}
|
||||
icon={<Volume1 size={16} strokeWidth={1.5} aria-hidden />}
|
||||
onClick={onNoticeOpen}
|
||||
/>
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
const NotificationButton = ({ unreadCount, onNoticeOpen, t }) => {
|
||||
const actualTheme = useActualTheme();
|
||||
const isDark = actualTheme === 'dark';
|
||||
|
||||
const buttonProps = {
|
||||
icon: <NoticeIcon size={19} />,
|
||||
'aria-label': t('系统公告'),
|
||||
onClick: onNoticeOpen,
|
||||
theme: 'borderless',
|
||||
type: 'tertiary',
|
||||
className:
|
||||
'!w-8 !h-8 sm:!w-9 sm:!h-9 !flex !items-center !justify-center hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !rounded-full !transition-all !duration-200 hover:!scale-[1.08] active:!scale-95',
|
||||
style: { color: isDark ? 'rgba(243,244,246,0.9)' : 'rgba(75,85,99,1)' },
|
||||
};
|
||||
|
||||
if (unreadCount > 0) {
|
||||
return (
|
||||
<Badge count={unreadCount} type='danger' overflowCount={99}>
|
||||
<Button {...buttonProps} />
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
|
||||
return <Button {...buttonProps} />;
|
||||
};
|
||||
|
||||
export default NotificationButton;
|
||||
|
||||
@@ -17,257 +17,26 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import { Button, Dropdown } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
import { Button, Tooltip } from 'antd';
|
||||
import { Moon, Sun } from 'lucide-react';
|
||||
import { useActualTheme } from '../../../context/Theme';
|
||||
|
||||
// 自定义浅色图标 — 带光芒的太阳
|
||||
const LightIcon = ({ size = 18, color = 'currentColor' }) => (
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox='0 0 24 24'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<circle cx='12' cy='12' r='4.5' stroke={color} strokeWidth='1.7' />
|
||||
<line
|
||||
x1='12'
|
||||
y1='2.5'
|
||||
x2='12'
|
||||
y2='5'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='12'
|
||||
y1='19'
|
||||
x2='12'
|
||||
y2='21.5'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='21.5'
|
||||
y1='12'
|
||||
x2='19'
|
||||
y2='12'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='5'
|
||||
y1='12'
|
||||
x2='2.5'
|
||||
y2='12'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='18.7'
|
||||
y1='5.3'
|
||||
x2='16.9'
|
||||
y2='7.1'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='7.1'
|
||||
y1='16.9'
|
||||
x2='5.3'
|
||||
y2='18.7'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='18.7'
|
||||
y1='18.7'
|
||||
x2='16.9'
|
||||
y2='16.9'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='7.1'
|
||||
y1='7.1'
|
||||
x2='5.3'
|
||||
y2='5.3'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
|
||||
// 自定义深色图标 — 带星星的弯月
|
||||
const DarkIcon = ({ size = 18, color = 'currentColor' }) => (
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox='0 0 24 24'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<path
|
||||
d='M20.5 13.5a8.5 8.5 0 01-10-10A8.5 8.5 0 1020.5 13.5z'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
strokeLinejoin='round'
|
||||
/>
|
||||
<circle cx='18' cy='5' r='0.8' fill={color} />
|
||||
<circle cx='20.5' cy='8' r='0.6' fill={color} />
|
||||
<circle cx='16' cy='3' r='0.5' fill={color} />
|
||||
</svg>
|
||||
);
|
||||
|
||||
// 自定义自动模式图标 — 半日半月
|
||||
const AutoIcon = ({ size = 18, color = 'currentColor' }) => (
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox='0 0 24 24'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<circle cx='12' cy='12' r='8.5' stroke={color} strokeWidth='1.7' />
|
||||
<path d='M12 3.5v17a8.5 8.5 0 000-17z' fill={color} fillOpacity='0.2' />
|
||||
<line
|
||||
x1='12'
|
||||
y1='1.5'
|
||||
x2='12'
|
||||
y2='3.5'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='12'
|
||||
y1='20.5'
|
||||
x2='12'
|
||||
y2='22.5'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='22.5'
|
||||
y1='12'
|
||||
x2='20.5'
|
||||
y2='12'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<line
|
||||
x1='3.5'
|
||||
y1='12'
|
||||
x2='1.5'
|
||||
y2='12'
|
||||
stroke={color}
|
||||
strokeWidth='1.7'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
|
||||
const ThemeToggle = ({ theme, onThemeToggle, t }) => {
|
||||
const actualTheme = useActualTheme();
|
||||
|
||||
const themeOptions = useMemo(
|
||||
() => [
|
||||
{
|
||||
key: 'light',
|
||||
icon: <LightIcon />,
|
||||
buttonIcon: <LightIcon />,
|
||||
label: t('浅色模式'),
|
||||
description: t('始终使用浅色主题'),
|
||||
},
|
||||
{
|
||||
key: 'dark',
|
||||
icon: <DarkIcon />,
|
||||
buttonIcon: <DarkIcon />,
|
||||
label: t('深色模式'),
|
||||
description: t('始终使用深色主题'),
|
||||
},
|
||||
{
|
||||
key: 'auto',
|
||||
icon: <AutoIcon />,
|
||||
buttonIcon: <AutoIcon />,
|
||||
label: t('自动模式'),
|
||||
description: t('跟随系统主题设置'),
|
||||
},
|
||||
],
|
||||
[t],
|
||||
);
|
||||
|
||||
const getItemClassName = (isSelected) =>
|
||||
isSelected
|
||||
? '!bg-semi-color-primary-light-default !font-semibold'
|
||||
: 'hover:!bg-semi-color-fill-1';
|
||||
|
||||
const currentButtonIcon = useMemo(() => {
|
||||
const currentOption = themeOptions.find((option) => option.key === theme);
|
||||
return currentOption?.buttonIcon || themeOptions[2].buttonIcon;
|
||||
}, [theme, themeOptions]);
|
||||
const ThemeToggle = ({ onThemeToggle, t }) => {
|
||||
const isDark = useActualTheme() === 'dark';
|
||||
const label = isDark ? t('切换至亮色主题') : t('切换至暗色主题');
|
||||
const Icon = isDark ? Sun : Moon;
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
position='bottomRight'
|
||||
render={
|
||||
<Dropdown.Menu>
|
||||
{themeOptions.map((option) => (
|
||||
<Dropdown.Item
|
||||
key={option.key}
|
||||
icon={option.icon}
|
||||
onClick={() => onThemeToggle(option.key)}
|
||||
className={getItemClassName(theme === option.key)}
|
||||
>
|
||||
<div className='flex flex-col'>
|
||||
<span>{option.label}</span>
|
||||
<span className='text-xs text-semi-color-text-2'>
|
||||
{option.description}
|
||||
</span>
|
||||
</div>
|
||||
</Dropdown.Item>
|
||||
))}
|
||||
|
||||
{theme === 'auto' && (
|
||||
<>
|
||||
<Dropdown.Divider />
|
||||
<div className='px-3 py-2 text-xs text-semi-color-text-2'>
|
||||
{t('当前跟随系统')}:
|
||||
{actualTheme === 'dark' ? t('深色') : t('浅色')}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</Dropdown.Menu>
|
||||
}
|
||||
>
|
||||
{/* Semi can resolve a DOM trigger directly without findDOMNode. */}
|
||||
<span className='inline-flex'>
|
||||
<Button
|
||||
icon={currentButtonIcon}
|
||||
aria-label={t('切换主题')}
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
className='!w-8 !h-8 sm:!w-9 sm:!h-9 !flex !items-center !justify-center hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !rounded-full !transition-all !duration-200 hover:!scale-[1.08] active:!scale-95'
|
||||
style={{
|
||||
color:
|
||||
actualTheme === 'dark'
|
||||
? 'rgba(243,244,246,0.9)'
|
||||
: 'rgba(75,85,99,1)',
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
</Dropdown>
|
||||
<Tooltip title={label}>
|
||||
<Button
|
||||
type='text'
|
||||
icon={<Icon size={16} strokeWidth={1.5} aria-hidden />}
|
||||
aria-label={t('切换主题')}
|
||||
className='ui-header-icon-action'
|
||||
onClick={() => onThemeToggle(isDark ? 'light' : 'dark')}
|
||||
/>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -17,19 +17,30 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { Avatar, Button, Dropdown, Typography } from '@douyinfe/semi-ui';
|
||||
import { ChevronDown, User, Key, LogOut } from 'lucide-react';
|
||||
import {
|
||||
getUserAvatarUrl,
|
||||
stringToColor,
|
||||
isAuthPagePath,
|
||||
} from '../../../helpers';
|
||||
import { Avatar, Button as AntButton, Dropdown as AntDropdown } from 'antd';
|
||||
import { Button } from '@/components/ui';
|
||||
import { ChevronDown, UserRound, KeyRound, LogOut } from 'lucide-react';
|
||||
import { getUserAvatarUrl, isAuthPagePath } from '../../../helpers';
|
||||
import SkeletonWrapper from '../components/SkeletonWrapper';
|
||||
import { useActualTheme } from '../../../context/Theme';
|
||||
import { isHeaderModuleEnabled } from '../../../constants/headerNavModules';
|
||||
|
||||
// 头像菜单项:图标框 + 标题 + 说明(原型 account-menu-label)
|
||||
const AccountMenuLabel = ({ icon, tone, title, description }) => (
|
||||
<div className='ui-account-menu-label'>
|
||||
<span className={`ui-account-menu-icon ui-account-menu-icon-${tone}`}>
|
||||
{icon}
|
||||
</span>
|
||||
<span>
|
||||
{title}
|
||||
<small>{description}</small>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
const MENU_ICON_PROPS = { size: 18, strokeWidth: 1.65, 'aria-hidden': true };
|
||||
|
||||
const UserArea = ({
|
||||
userState,
|
||||
isLoading,
|
||||
@@ -38,13 +49,13 @@ const UserArea = ({
|
||||
headerNavModules,
|
||||
rightActions = {},
|
||||
sidebarModulesAdmin = {},
|
||||
isOrgUser = false,
|
||||
logout,
|
||||
navigate,
|
||||
t,
|
||||
}) => {
|
||||
const location = useLocation();
|
||||
const actualTheme = useActualTheme();
|
||||
const isDark = actualTheme === 'dark';
|
||||
const [open, setOpen] = useState(false);
|
||||
const isActionVisible = (key) => rightActions?.[key] !== false;
|
||||
const hasHeaderModuleConfig =
|
||||
headerNavModules && Object.keys(headerNavModules).length > 0;
|
||||
@@ -73,271 +84,113 @@ const UserArea = ({
|
||||
if (userState.user) {
|
||||
const displayName = userState.user.display_name || userState.user.username;
|
||||
const avatarUrl = getUserAvatarUrl(userState.user);
|
||||
const avatarInitial = displayName[0].toUpperCase();
|
||||
|
||||
const showSettings =
|
||||
isActionVisible('userSettings') &&
|
||||
isTopNavModuleVisible('userCenter') &&
|
||||
isSidebarModuleVisible('userCenter', 'settings');
|
||||
// 「秘钥管理快捷入口」由 rightActions.keyManagement 单独控制(运营设置→顶栏管理)。
|
||||
// 个人用户的 /user-center/key-management 路由不依赖顶栏模块是否显示,故顶栏导航隐藏该模块时
|
||||
// 头像菜单仍保留入口;企业员工只有在其顶栏模块放开时路由才被放行,继续联动判断。
|
||||
const showKeyManagement =
|
||||
isActionVisible('keyManagement') &&
|
||||
(!isOrgUser || isTopNavModuleVisible('keyManagement'));
|
||||
|
||||
const items = [];
|
||||
if (showSettings) {
|
||||
items.push({
|
||||
key: 'settings',
|
||||
label: (
|
||||
<AccountMenuLabel
|
||||
tone='user'
|
||||
icon={<UserRound {...MENU_ICON_PROPS} />}
|
||||
title={t('个人设置')}
|
||||
description={t('管理账户信息')}
|
||||
/>
|
||||
),
|
||||
onClick: () => navigate('/user-center/settings'),
|
||||
});
|
||||
}
|
||||
if (showKeyManagement) {
|
||||
items.push({
|
||||
key: 'keys',
|
||||
label: (
|
||||
<AccountMenuLabel
|
||||
tone='key'
|
||||
icon={<KeyRound {...MENU_ICON_PROPS} />}
|
||||
title={t('密钥管理')}
|
||||
description={t('查看和管理 API 密钥')}
|
||||
/>
|
||||
),
|
||||
onClick: () => navigate('/user-center/key-management'),
|
||||
});
|
||||
}
|
||||
items.push({ key: 'account-divider', type: 'divider' });
|
||||
items.push({
|
||||
key: 'logout',
|
||||
label: (
|
||||
<AccountMenuLabel
|
||||
tone='logout'
|
||||
icon={<LogOut {...MENU_ICON_PROPS} />}
|
||||
title={t('退出登录')}
|
||||
description={t('安全退出账户')}
|
||||
/>
|
||||
),
|
||||
onClick: logout,
|
||||
});
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
trigger='hover'
|
||||
position='bottomRight'
|
||||
showTick
|
||||
render={
|
||||
<Dropdown.Menu
|
||||
className='!min-w-[180px] !p-2 !backdrop-blur-xl !border !shadow-xl !rounded-xl'
|
||||
style={{
|
||||
backgroundColor: isDark
|
||||
? 'rgba(31,41,55,0.95)'
|
||||
: 'rgba(255,255,255,0.95)',
|
||||
borderColor: isDark ? 'rgba(55,65,81,1)' : 'rgba(243,244,246,1)',
|
||||
boxShadow: isDark
|
||||
? '0 20px 25px -5px rgba(0,0,0,0.3)'
|
||||
: '0 20px 25px -5px rgba(0,0,0,0.05)',
|
||||
}}
|
||||
>
|
||||
{/* 用户信息头部 */}
|
||||
<div
|
||||
className='px-3 py-2 mb-2 border-b'
|
||||
style={{
|
||||
borderColor: isDark
|
||||
? 'rgba(55,65,81,1)'
|
||||
: 'rgba(243,244,246,1)',
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center gap-3'>
|
||||
<Avatar
|
||||
size='small'
|
||||
src={avatarUrl}
|
||||
color={stringToColor(displayName)}
|
||||
className='!w-8 !h-8 !text-xs'
|
||||
>
|
||||
{displayName[0].toUpperCase()}
|
||||
</Avatar>
|
||||
<div>
|
||||
<div
|
||||
className='text-sm font-semibold'
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(243,244,246,0.9)'
|
||||
: 'rgba(31,41,55,1)',
|
||||
}}
|
||||
>
|
||||
{displayName}
|
||||
</div>
|
||||
<div
|
||||
className='text-xs'
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(107,114,128,1)'
|
||||
: 'rgba(156,163,175,1)',
|
||||
}}
|
||||
>
|
||||
{userState.user.email || t('已登录')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isActionVisible('userSettings') &&
|
||||
isTopNavModuleVisible('userCenter') &&
|
||||
isSidebarModuleVisible('userCenter', 'settings') && (
|
||||
<Dropdown.Item
|
||||
onClick={() => {
|
||||
navigate('/user-center/settings');
|
||||
}}
|
||||
className='!px-3 !py-2.5 !rounded-lg !text-sm !transition-all !duration-200'
|
||||
style={{
|
||||
color: isDark ? 'rgba(229,231,235,1)' : 'rgba(55,65,81,1)',
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center gap-3'>
|
||||
<div
|
||||
className='w-8 h-8 rounded-lg flex items-center justify-center'
|
||||
style={{
|
||||
background: isDark
|
||||
? 'rgba(30,58,138,0.5)'
|
||||
: 'linear-gradient(to bottom right, rgba(219,234,254,1), rgba(224,231,255,1))',
|
||||
}}
|
||||
>
|
||||
<User
|
||||
size={16}
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(96,165,250,1)'
|
||||
: 'rgba(37,99,235,1)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
className='font-medium'
|
||||
style={{
|
||||
color: isDark ? 'rgba(243,244,246,0.9)' : undefined,
|
||||
}}
|
||||
>
|
||||
{t('个人设置')}
|
||||
</div>
|
||||
<div
|
||||
className='text-xs'
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(107,114,128,1)'
|
||||
: 'rgba(156,163,175,1)',
|
||||
}}
|
||||
>
|
||||
{t('管理账户信息')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Dropdown.Item>
|
||||
)}
|
||||
|
||||
{isActionVisible('keyManagement') &&
|
||||
isTopNavModuleVisible('keyManagement') && (
|
||||
<Dropdown.Item
|
||||
onClick={() => {
|
||||
navigate('/key-management');
|
||||
}}
|
||||
className='!px-3 !py-2.5 !rounded-lg !text-sm !transition-all !duration-200'
|
||||
style={{
|
||||
color: isDark ? 'rgba(229,231,235,1)' : 'rgba(55,65,81,1)',
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center gap-3'>
|
||||
<div
|
||||
className='w-8 h-8 rounded-lg flex items-center justify-center'
|
||||
style={{
|
||||
background: isDark
|
||||
? 'rgba(120,53,15,0.5)'
|
||||
: 'linear-gradient(to bottom right, rgba(254,243,199,1), rgba(255,237,213,1))',
|
||||
}}
|
||||
>
|
||||
<Key
|
||||
size={16}
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(251,191,36,1)'
|
||||
: 'rgba(217,119,6,1)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
className='font-medium'
|
||||
style={{
|
||||
color: isDark ? 'rgba(243,244,246,0.9)' : undefined,
|
||||
}}
|
||||
>
|
||||
{t('秘钥管理')}
|
||||
</div>
|
||||
<div
|
||||
className='text-xs'
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(107,114,128,1)'
|
||||
: 'rgba(156,163,175,1)',
|
||||
}}
|
||||
>
|
||||
{t('查看和管理API秘钥')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Dropdown.Item>
|
||||
)}
|
||||
|
||||
<div
|
||||
className='my-2 border-t'
|
||||
style={{
|
||||
borderColor: isDark
|
||||
? 'rgba(55,65,81,1)'
|
||||
: 'rgba(243,244,246,1)',
|
||||
}}
|
||||
/>
|
||||
|
||||
<Dropdown.Item
|
||||
onClick={logout}
|
||||
className='!px-3 !py-2.5 !rounded-lg !text-sm !transition-all !duration-200'
|
||||
style={{
|
||||
color: isDark ? 'rgba(229,231,235,1)' : 'rgba(55,65,81,1)',
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center gap-3'>
|
||||
<div
|
||||
className='w-8 h-8 rounded-lg flex items-center justify-center'
|
||||
style={{
|
||||
background: isDark
|
||||
? 'rgba(127,29,29,0.5)'
|
||||
: 'linear-gradient(to bottom right, rgba(254,226,226,1), rgba(255,228,230,1))',
|
||||
}}
|
||||
>
|
||||
<LogOut
|
||||
size={16}
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(248,113,113,1)'
|
||||
: 'rgba(220,38,38,1)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
className='font-medium'
|
||||
style={{
|
||||
color: isDark ? 'rgba(243,244,246,0.9)' : undefined,
|
||||
}}
|
||||
>
|
||||
{t('退出登录')}
|
||||
</div>
|
||||
<div
|
||||
className='text-xs'
|
||||
style={{
|
||||
color: isDark
|
||||
? 'rgba(107,114,128,1)'
|
||||
: 'rgba(156,163,175,1)',
|
||||
}}
|
||||
>
|
||||
{t('安全退出账户')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Dropdown.Item>
|
||||
</Dropdown.Menu>
|
||||
}
|
||||
>
|
||||
<span className='inline-flex'>
|
||||
<Button
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
className='flex items-center gap-2 !pl-1.5 !pr-2.5 !py-1.5 !h-10 !rounded-full hover:!bg-brand/10 dark:hover:!bg-brand/15 !bg-transparent !transition-all !duration-200 hover:!-translate-y-0.5 group'
|
||||
>
|
||||
<div className='relative'>
|
||||
<AntDropdown
|
||||
trigger={['hover']}
|
||||
placement='bottomRight'
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
overlayClassName='ui-account-dropdown'
|
||||
menu={{ items, onClick: () => setOpen(false) }}
|
||||
popupRender={(menu) => (
|
||||
<div className='ui-account-panel'>
|
||||
<div className='ui-account-summary'>
|
||||
<Avatar
|
||||
size='small'
|
||||
shape='square'
|
||||
size={40}
|
||||
src={avatarUrl}
|
||||
color={stringToColor(displayName)}
|
||||
className='!w-7 !h-7 !text-xs ring-2 ring-white dark:ring-gray-800 group-hover:!ring-brand/40 dark:group-hover:!ring-brand/50 transition-all'
|
||||
className='ui-account-avatar'
|
||||
>
|
||||
{displayName[0].toUpperCase()}
|
||||
{avatarInitial}
|
||||
</Avatar>
|
||||
{/* 在线状态点 */}
|
||||
<span className='absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 bg-emerald-500 border-2 border-white dark:border-gray-800 rounded-full' />
|
||||
<div>
|
||||
<strong>{displayName}</strong>
|
||||
<span>{userState.user.email || t('已登录')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<span className='hidden md:flex flex-col items-start'>
|
||||
<Typography.Text
|
||||
className='!text-sm !font-medium !leading-none'
|
||||
style={{
|
||||
color: isDark ? 'rgba(243,244,246,0.9)' : 'rgba(55,65,81,1)',
|
||||
}}
|
||||
>
|
||||
{displayName}
|
||||
</Typography.Text>
|
||||
</span>
|
||||
<ChevronDown
|
||||
size={14}
|
||||
style={{
|
||||
color: isDark ? 'rgba(209,213,219,1)' : 'rgba(156,163,175,1)',
|
||||
}}
|
||||
className='group-hover:!opacity-80 transition-colors'
|
||||
/>
|
||||
</Button>
|
||||
</span>
|
||||
</Dropdown>
|
||||
{menu}
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<AntButton
|
||||
type='text'
|
||||
className='ui-header-account'
|
||||
aria-haspopup='menu'
|
||||
aria-expanded={open}
|
||||
>
|
||||
<Avatar
|
||||
shape='square'
|
||||
size={38}
|
||||
src={avatarUrl}
|
||||
className='ui-account-avatar'
|
||||
>
|
||||
{avatarInitial}
|
||||
</Avatar>
|
||||
<span className='ui-header-account-name'>{displayName}</span>
|
||||
<ChevronDown
|
||||
size={10}
|
||||
strokeWidth={1.5}
|
||||
aria-hidden
|
||||
className={`ui-header-account-chevron${open ? ' is-open' : ''}`}
|
||||
/>
|
||||
</AntButton>
|
||||
</AntDropdown>
|
||||
);
|
||||
} else {
|
||||
if (isAuthPage) {
|
||||
@@ -356,7 +209,7 @@ const UserArea = ({
|
||||
let registerButtonClasses = `${commonSizingAndLayoutClass}`;
|
||||
|
||||
const loginButtonTextSpanClass =
|
||||
'!text-xs !text-semi-color-text-1 dark:!text-gray-300 !p-1.5';
|
||||
'!text-xs !text-ui-color-text-1 dark:!text-gray-300 !p-1.5';
|
||||
const registerButtonTextSpanClass = '!text-xs !text-white !p-1.5';
|
||||
|
||||
if (showRegisterButton) {
|
||||
|
||||
@@ -74,7 +74,7 @@ const HeaderBar = ({ onMobileMenuToggle, drawerOpen }) => {
|
||||
|
||||
const userRole = userState?.user?.role || 0;
|
||||
const userGroup = userState?.user?.group || 'default';
|
||||
const { mainNavLinks } = useNavigation(
|
||||
const { mainNavLinks: configuredNavLinks } = useNavigation(
|
||||
t,
|
||||
docsLink,
|
||||
headerNavModules,
|
||||
@@ -82,9 +82,12 @@ const HeaderBar = ({ onMobileMenuToggle, drawerOpen }) => {
|
||||
userGroup,
|
||||
{ showOrgEntry, orgEntryPath },
|
||||
);
|
||||
const mainNavLinks = configuredNavLinks.filter(
|
||||
(link) => link.itemKey !== 'keyManagement',
|
||||
);
|
||||
|
||||
return (
|
||||
<header className='text-semi-color-text-0 sticky top-0 z-50 transition-all duration-300 relative'>
|
||||
<header className='text-ui-color-text-0 sticky top-0 z-50 transition-all duration-300 relative'>
|
||||
{/* ===== BACKGROUND LAYERS ===== */}
|
||||
|
||||
{/* Main gradient background with glassmorphism */}
|
||||
@@ -116,12 +119,12 @@ const HeaderBar = ({ onMobileMenuToggle, drawerOpen }) => {
|
||||
unreadKeys={getUnreadKeys()}
|
||||
/>
|
||||
|
||||
<div className='relative w-full px-2 sm:px-3 md:px-4'>
|
||||
<div className='ui-topbar relative w-full'>
|
||||
{/* 高度断点必须用 md(768) 而非 sm(640):PageLayout 的 headerBarHeight 按
|
||||
MOBILE_BREAKPOINT=768 算 56/64,用 sm 会让 640~767px 区间实际 64px、
|
||||
而侧栏 top、抽屉遮罩 top 全按 56px 定位,差 8px。 */}
|
||||
<div className='flex items-center justify-between gap-1 md:gap-0 h-14 md:h-16'>
|
||||
<div className='flex items-center min-w-0 md:min-w-[auto]'>
|
||||
<div className='flex items-center justify-between gap-1 md:gap-0 h-14 md:h-[72px]'>
|
||||
<div className='ui-header-brand flex items-center min-w-0 md:min-w-[auto]'>
|
||||
<MobileMenuButton
|
||||
isConsoleRoute={isConsoleRoute}
|
||||
isMobile={isMobile}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
.notice-modal-root .ant-modal-mask {
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
.notice-modal.ant-modal {
|
||||
top: 100px;
|
||||
max-width: calc(100vw - 32px);
|
||||
padding-bottom: 24px;
|
||||
color: var(--nm-text);
|
||||
}
|
||||
.notice-modal .ant-modal-content {
|
||||
padding: 20px 24px;
|
||||
background: var(--nm-surface);
|
||||
border-radius: 12px;
|
||||
}
|
||||
.notice-modal .ant-modal-header {
|
||||
margin-bottom: 16px;
|
||||
background: var(--nm-surface);
|
||||
}
|
||||
.notice-modal .ant-modal-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 24px;
|
||||
}
|
||||
.notice-modal .ant-modal-close {
|
||||
top: 12px;
|
||||
inset-inline-end: 12px;
|
||||
}
|
||||
.notice-modal .ant-segmented {
|
||||
height: 48px;
|
||||
padding: 4px;
|
||||
border-radius: 10px;
|
||||
background: var(--nm-tab-bg);
|
||||
color: var(--nm-muted);
|
||||
}
|
||||
.notice-modal .ant-segmented-item-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
min-height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
.notice-modal .ant-segmented-item-icon {
|
||||
display: inline-flex;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
.notice-modal .ant-segmented-item-selected {
|
||||
color: var(--nm-primary);
|
||||
background: var(--nm-surface);
|
||||
box-shadow: inset 0 0 0 1px var(--nm-border);
|
||||
}
|
||||
.nm-system-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.nm-body {
|
||||
margin-top: 18px;
|
||||
}
|
||||
.nm-notice-scroll,
|
||||
.nm-announcement-scroll {
|
||||
max-height: min(470px, calc(100dvh - 300px));
|
||||
overflow: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.nm-notice-scroll {
|
||||
padding: 20px;
|
||||
border: 1px solid var(--nm-border);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.nm-markdown {
|
||||
color: var(--nm-text);
|
||||
font-size: 14px;
|
||||
line-height: 25px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.nm-markdown > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.nm-markdown > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.nm-markdown p {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
.nm-markdown h1,
|
||||
.nm-markdown h2,
|
||||
.nm-markdown h3,
|
||||
.nm-markdown h4 {
|
||||
margin: 20px 0 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 24px;
|
||||
}
|
||||
.nm-markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.nm-markdown a {
|
||||
color: var(--nm-primary);
|
||||
}
|
||||
.nm-markdown ul,
|
||||
.nm-markdown ol {
|
||||
margin: 0 0 10px;
|
||||
padding-inline-start: 24px;
|
||||
}
|
||||
.nm-markdown ul {
|
||||
list-style: disc;
|
||||
}
|
||||
.nm-markdown ol {
|
||||
list-style: decimal;
|
||||
}
|
||||
.nm-markdown pre {
|
||||
overflow: auto;
|
||||
padding: 16px;
|
||||
background: var(--nm-fill);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.nm-markdown img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.nm-markdown table {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.nm-markdown td,
|
||||
.nm-markdown th {
|
||||
padding: 8px;
|
||||
border: 1px solid var(--nm-border);
|
||||
}
|
||||
.nm-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: min(300px, calc(100dvh - 300px));
|
||||
min-height: 80px;
|
||||
color: var(--nm-muted);
|
||||
font-size: 16px;
|
||||
}
|
||||
.nm-spin-placeholder {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
}
|
||||
.nm-announcement-scroll {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
.nm-announcement-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
color: var(--nm-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
.nm-announcement-extra {
|
||||
margin-top: 8px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid var(--nm-border);
|
||||
}
|
||||
.notice-modal .ant-modal-footer {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.nm-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
@media (max-width: 600px), (max-height: 650px) {
|
||||
.notice-modal.ant-modal {
|
||||
top: 24px;
|
||||
}
|
||||
.notice-modal .ant-modal-content {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
.nm-notice-scroll,
|
||||
.nm-announcement-scroll {
|
||||
max-height: calc(100dvh - 248px);
|
||||
}
|
||||
.nm-notice-scroll {
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user