feat: integrate NotificationBell into MainLayout header

This commit is contained in:
2026-07-05 23:19:27 +08:00
parent f47b7aaf87
commit 168308347f

View File

@@ -26,6 +26,7 @@ import {
LaptopOutlined,
} from '@ant-design/icons';
import { usePermission } from '../hooks/usePermission';
import NotificationBell from '../components/NotificationBell';
const { Header, Sider, Content } = Layout;
@@ -264,24 +265,26 @@ const MainLayout: React.FC = () => {
)
}
onClick={() => (isMobile || isTablet ? setDrawerOpen(true) : setCollapsed(!collapsed))}
/>
<Dropdown
menu={{
items: [
{
key: 'logout',
icon: <LogoutOutlined />,
label: '退出登录',
onClick: handleLogout,
},
],
}}
>
<div style={{ cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 8 }}>
<Avatar icon={<UserOutlined />} />
{isDesktop && <span>{user.name || user.username || '用户'}</span>}
</div>
</Dropdown>
<div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
<NotificationBell />
<Dropdown
menu={{
items: [
{
key: 'logout',
icon: <LogoutOutlined />,
label: '退出登录',
onClick: handleLogout,
},
],
}}
>
<div style={{ cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 8 }}>
<Avatar icon={<UserOutlined />} />
{isDesktop && <span>{user.name || user.username || '用户'}</span>}
</div>
</Dropdown>
</div>
</Header>
<Content
style={{