feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user