From bf87518161445e2fcbe45585e4b618a4ec8fb2db Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 30 Dec 2015 15:26:54 +1030 Subject: [PATCH] Use username helper when displaying user search results --- js/forum/src/components/UsersSearchSource.js | 22 +++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/js/forum/src/components/UsersSearchSource.js b/js/forum/src/components/UsersSearchSource.js index f1b2d5222..0ea76e22c 100644 --- a/js/forum/src/components/UsersSearchSource.js +++ b/js/forum/src/components/UsersSearchSource.js @@ -1,5 +1,6 @@ import highlight from 'flarum/helpers/highlight'; import avatar from 'flarum/helpers/avatar'; +import username from 'flarum/helpers/username'; /** * The `UsersSearchSource` finds and displays user search results in the search @@ -23,14 +24,19 @@ export default class UsersSearchResults { return [
  • {app.translator.trans('core.forum.search.users_heading')}
  • , - results.map(user => ( -
  • - - {avatar(user)} - {highlight(user.username(), query)} - -
  • - )) + results.map(user => { + const name = username(user); + name.children[0] = highlight(name.children[0], query); + + return ( +
  • + + {avatar(user)} + {name} + +
  • + ); + }) ]; } }