forked from wangziqi/gongxue-base
feat: integrate NotificationBell into MainLayout header
This commit is contained in:
@@ -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={{
|
||||
|
||||
Reference in New Issue
Block a user