From f50a11b885514fb4e9638fb32d603e5da15e8fe1 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 --- .../forum/src/components/UsersSearchSource.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/framework/core/js/forum/src/components/UsersSearchSource.js b/framework/core/js/forum/src/components/UsersSearchSource.js index f1b2d5222..0ea76e22c 100644 --- a/framework/core/js/forum/src/components/UsersSearchSource.js +++ b/framework/core/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} + +
  • + ); + }) ]; } }