File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
ui/src/pages/Users/Notifications/components/Inbox Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 404
404
achievement : Achievements
405
405
all_read : Mark all as read
406
406
show_more : Show more
407
+ someone : Someone
407
408
suspended :
408
409
title : Your Account has been Suspended
409
410
until_time : " Your account was suspended until {{ time }}."
Original file line number Diff line number Diff line change 384
384
achievement : 成就
385
385
all_read : 全部标记为已读
386
386
show_more : 显示更多
387
+ someone : 有人
387
388
suspended :
388
389
title : 账号已封禁
389
390
until_time : " 你的账号被封禁至{{ time }}。"
Original file line number Diff line number Diff line change 1
1
import { ListGroup } from 'react-bootstrap' ;
2
2
import { Link } from 'react-router-dom' ;
3
+ import { useTranslation } from 'react-i18next' ;
3
4
4
5
import classNames from 'classnames' ;
5
6
import { isEmpty } from 'lodash' ;
6
7
7
8
import { FormatTime , Empty } from '@/components' ;
8
9
9
10
const Inbox = ( { data, handleReadNotification } ) => {
11
+ const { t } = useTranslation ( 'translation' , { keyPrefix : 'notifications' } ) ;
10
12
if ( ! data ) {
11
13
return null ;
12
14
}
@@ -40,12 +42,13 @@ const Inbox = ({ data, handleReadNotification }) => {
40
42
! item . is_read && 'warning' ,
41
43
) } >
42
44
< div >
43
- { item . user_info . status !== 'deleted' ? (
45
+ { item . user_info && item . user_info . status !== 'deleted' ? (
44
46
< Link to = { `/users/${ item . user_info . username } ` } >
45
47
{ item . user_info . display_name } { ' ' }
46
48
</ Link >
47
49
) : (
48
- < span > { item . user_info . display_name } </ span >
50
+ // someone for anonymous user display
51
+ < span > { item . user_info ?. display_name || t ( 'someone' ) } </ span >
49
52
) }
50
53
{ item . notification_action } { ' ' }
51
54
< Link to = { url } onClick = { ( ) => handleReadNotification ( item . id ) } >
You can’t perform that action at this time.
0 commit comments