mirror of https://gitee.com/answerdev/answer.git
fix: add someone for anonymous user display
This commit is contained in:
parent
7d722cde4f
commit
016fd7b412
|
@ -332,6 +332,7 @@ ui:
|
||||||
achievement: Achievements
|
achievement: Achievements
|
||||||
all_read: Mark all as read
|
all_read: Mark all as read
|
||||||
show_more: Show more
|
show_more: Show more
|
||||||
|
someone: Someone
|
||||||
suspended:
|
suspended:
|
||||||
title: Your Account has been Suspended
|
title: Your Account has been Suspended
|
||||||
until_time: "Your account was suspended until {{ time }}."
|
until_time: "Your account was suspended until {{ time }}."
|
||||||
|
|
|
@ -316,6 +316,7 @@ ui:
|
||||||
achievement: 成就
|
achievement: 成就
|
||||||
all_read: 全部标记为已读
|
all_read: 全部标记为已读
|
||||||
show_more: 显示更多
|
show_more: 显示更多
|
||||||
|
someone: 有人
|
||||||
suspended:
|
suspended:
|
||||||
title: 账号已封禁
|
title: 账号已封禁
|
||||||
until_time: "你的账号被封禁至{{ time }}。"
|
until_time: "你的账号被封禁至{{ time }}。"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ListGroup } from 'react-bootstrap';
|
import { ListGroup } from 'react-bootstrap';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
|
@ -7,6 +8,7 @@ import { isEmpty } from 'lodash';
|
||||||
import { FormatTime, Empty } from '@/components';
|
import { FormatTime, Empty } from '@/components';
|
||||||
|
|
||||||
const Inbox = ({ data, handleReadNotification }) => {
|
const Inbox = ({ data, handleReadNotification }) => {
|
||||||
|
const { t } = useTranslation('translation', { keyPrefix: 'notifications' });
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -40,12 +42,13 @@ const Inbox = ({ data, handleReadNotification }) => {
|
||||||
!item.is_read && 'warning',
|
!item.is_read && 'warning',
|
||||||
)}>
|
)}>
|
||||||
<div>
|
<div>
|
||||||
{item.user_info.status !== 'deleted' ? (
|
{item.user_info && item.user_info.status !== 'deleted' ? (
|
||||||
<Link to={`/users/${item.user_info.username}`}>
|
<Link to={`/users/${item.user_info.username}`}>
|
||||||
{item.user_info.display_name}{' '}
|
{item.user_info.display_name}{' '}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{item.user_info.display_name} </span>
|
// someone for anonymous user display
|
||||||
|
<span>{item.user_info?.display_name || t('someone')} </span>
|
||||||
)}
|
)}
|
||||||
{item.notification_action}{' '}
|
{item.notification_action}{' '}
|
||||||
<Link to={url} onClick={() => handleReadNotification(item.id)}>
|
<Link to={url} onClick={() => handleReadNotification(item.id)}>
|
||||||
|
|
Loading…
Reference in New Issue