fix: refactor notification display logic and add format function

This commit is contained in:
xyx
2026-07-13 14:52:03 +08:00
parent 6d42241918
commit 910a4263f6
4 changed files with 39 additions and 16 deletions

View File

@@ -10,6 +10,7 @@ import {
import { useNavigate } from 'react-router-dom';
import api from '../../api';
import { message } from '../../ui/app-message';
import { formatNotificationText } from '../../utils/notification-display';
const { Sider, Content } = Layout;
@@ -169,7 +170,7 @@ const NotificationsPage: React.FC = () => {
strong={!item.isRead}
style={{ fontSize: 15 }}
>
{item.title}
{formatNotificationText(item.title)}
</Typography.Text>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
{timeAgo(item.createdAt)}
@@ -183,7 +184,7 @@ const NotificationsPage: React.FC = () => {
ellipsis={{ rows: 1 }}
style={{ marginBottom: 0 }}
>
{item.content}
{formatNotificationText(item.content)}
</Typography.Paragraph>
)
}