@@ -128,7 +128,7 @@ export default class DiscussionListItem<CustomAttrs extends IDiscussionListItemA
128
128
items . add ( 'authorAvatar' , this . authorAvatarView ( ) , 100 ) ;
129
129
items . add ( 'badges' , this . badgesView ( ) , 90 ) ;
130
130
items . add ( 'main' , this . mainView ( ) , 80 ) ;
131
- items . add ( 'replyCount' , this . replyCountItem ( ) . toArray ( ) , 70 ) ;
131
+ items . add ( 'replyCount' , this . replyCountItem ( ) , 70 ) ;
132
132
133
133
return items ;
134
134
}
@@ -274,38 +274,30 @@ export default class DiscussionListItem<CustomAttrs extends IDiscussionListItemA
274
274
return items ;
275
275
}
276
276
277
- replyCountItem ( ) : ItemList < Mithril . Children > {
278
- const items = new ItemList < Mithril . Children > ( ) ;
279
-
277
+ replyCountItem ( ) {
280
278
const discussion = this . attrs . discussion ;
281
279
const showUnread = ! this . showRepliesCount ( ) && discussion . isUnread ( ) ;
282
280
283
281
if ( showUnread ) {
284
- items . add (
285
- 'unreadCount' ,
282
+ return (
286
283
< button className = "Button--ua-reset DiscussionListItem-count" onclick = { this . markAsRead . bind ( this ) } >
287
284
< span aria-hidden = "true" > { abbreviateNumber ( discussion . unreadCount ( ) ) } </ span >
288
285
289
286
< span className = "visually-hidden" >
290
287
{ app . translator . trans ( 'core.forum.discussion_list.unread_replies_a11y_label' , { count : discussion . replyCount ( ) } ) }
291
288
</ span >
292
- </ button > ,
293
- 100
294
- ) ;
295
- } else {
296
- items . add (
297
- 'count' ,
298
- < span className = "DiscussionListItem-count" >
299
- < span aria-hidden = "true" > { abbreviateNumber ( discussion . replyCount ( ) ) } </ span >
300
-
301
- < span className = "visually-hidden" >
302
- { app . translator . trans ( 'core.forum.discussion_list.total_replies_a11y_label' , { count : discussion . replyCount ( ) } ) }
303
- </ span >
304
- </ span > ,
305
- 100
289
+ </ button >
306
290
) ;
307
291
}
308
292
309
- return items ;
293
+ return (
294
+ < span className = "DiscussionListItem-count" >
295
+ < span aria-hidden = "true" > { abbreviateNumber ( discussion . replyCount ( ) ) } </ span >
296
+
297
+ < span className = "visually-hidden" >
298
+ { app . translator . trans ( 'core.forum.discussion_list.total_replies_a11y_label' , { count : discussion . replyCount ( ) } ) }
299
+ </ span >
300
+ </ span >
301
+ ) ;
310
302
}
311
303
}
0 commit comments