feat(messages): 新增 PC 消息中心与订单群聊入口
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { Button, Dropdown, Layout, Space, Typography } from 'antd'
|
||||
import { Badge, Button, Dropdown, Layout, Space, Typography } from 'antd'
|
||||
import { Link, Outlet, useNavigate } from 'react-router-dom'
|
||||
import { UserOutlined } from '@ant-design/icons'
|
||||
|
||||
import { BrandLogo } from '@/components/BrandLogo'
|
||||
import { useChatUnreadCount } from '@/features/messages/api'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
|
||||
const { Header, Content, Footer } = Layout
|
||||
@@ -11,6 +12,7 @@ export function StorefrontLayout() {
|
||||
const navigate = useNavigate()
|
||||
const user = useSessionStore(state => state.user)
|
||||
const logout = useSessionStore(state => state.logout)
|
||||
const unreadMessages = useChatUnreadCount(Boolean(user)).data ?? 0
|
||||
|
||||
return (
|
||||
<Layout className="site-shell">
|
||||
@@ -24,6 +26,11 @@ export function StorefrontLayout() {
|
||||
<Link to="/">首页</Link>
|
||||
<a href="/#listings">商品</a>
|
||||
<Link to="/orders">我的订单</Link>
|
||||
<Link to="/messages">
|
||||
<Badge count={unreadMessages} size="small" offset={[8, -2]}>
|
||||
<span>消息</span>
|
||||
</Badge>
|
||||
</Link>
|
||||
<a href="/#process">流程</a>
|
||||
<a href="/#rules">规则</a>
|
||||
</nav>
|
||||
@@ -39,6 +46,11 @@ export function StorefrontLayout() {
|
||||
label: '我的订单',
|
||||
onClick: () => navigate('/orders'),
|
||||
},
|
||||
{
|
||||
key: 'messages',
|
||||
label: '我的消息',
|
||||
onClick: () => navigate('/messages'),
|
||||
},
|
||||
{
|
||||
key: 'logout',
|
||||
label: '退出登录',
|
||||
|
||||
Reference in New Issue
Block a user