Add bot badge to account headers in the WebUI

This commit is contained in:
Thibaut Girka 2018-05-09 22:19:10 +02:00
parent 2f01935cba
commit 5d8052e715
2 changed files with 11 additions and 0 deletions

View File

@ -38,6 +38,8 @@ export default class Header extends ImmutablePureComponent {
let displayName = account.get('display_name_html'); let displayName = account.get('display_name_html');
let fields = account.get('fields'); let fields = account.get('fields');
let badge = account.get('bot') ? (<div className='roles'><div className='account-role bot'><FormattedMessage id='account.badges.bot' defaultMessage='Bot' /></div></div>) : null;
let info = ''; let info = '';
let mutingInfo = ''; let mutingInfo = '';
let actionBtn = ''; let actionBtn = '';
@ -99,6 +101,9 @@ export default class Header extends ImmutablePureComponent {
<span className='account__header__display-name' dangerouslySetInnerHTML={{ __html: displayName }} /> <span className='account__header__display-name' dangerouslySetInnerHTML={{ __html: displayName }} />
<span className='account__header__username'>@{account.get('acct')} {account.get('locked') ? <i className='fa fa-lock' /> : null}</span> <span className='account__header__username'>@{account.get('acct')} {account.get('locked') ? <i className='fa fa-lock' /> : null}</span>
{badge}
<div className='account__header__content' dangerouslySetInnerHTML={{ __html: emojify(text) }} /> <div className='account__header__content' dangerouslySetInnerHTML={{ __html: emojify(text) }} />
{fields.size > 0 && ( {fields.size > 0 && (

View File

@ -509,3 +509,9 @@
margin-bottom: 0; margin-bottom: 0;
} }
} }
.account__header .roles {
margin-top: 20px;
margin-bottom: 20px;
padding: 0 15px;
}