mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 09:03:36 +08:00
49d59089e4
- Changes all `app.trans` calls to `app.translator.trans` calls. - Changes existing keys to [three-tier namespace structure](https://github.com/flarum/english/pull/12). - Extracts additional strings for `lib:` namespace. - Extracts two previously missed strings for EditGroupModal.js.
13 lines
405 B
JavaScript
13 lines
405 B
JavaScript
/**
|
|
* The `username` helper displays a user's username in a <span class="username">
|
|
* tag. If the user doesn't exist, the username will be displayed as [deleted].
|
|
*
|
|
* @param {User} user
|
|
* @return {Object}
|
|
*/
|
|
export default function username(user) {
|
|
const name = (user && user.username()) || app.translator.trans('core.lib.deleted_user_text');
|
|
|
|
return <span className="username">{name}</span>;
|
|
}
|