kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
ProfileInfoPanel: avoid redundant staff badge
If the user is an admin, don't display the moderator badgenank-fix
rodzic
955a4863f0
commit
4c82b4703b
|
@ -46,6 +46,18 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
||||||
displayFqn: PropTypes.bool,
|
displayFqn: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getStaffBadge = () => {
|
||||||
|
const { account } = this.props;
|
||||||
|
|
||||||
|
if (isAdmin(account)) {
|
||||||
|
return <Badge slug='admin' title='Admin' />;
|
||||||
|
} else if (isModerator(account)) {
|
||||||
|
return <Badge slug='moderator' title='Moderator' />;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { account, displayFqn, intl, identity_proofs, username } = this.props;
|
const { account, displayFqn, intl, identity_proofs, username } = this.props;
|
||||||
|
|
||||||
|
@ -86,8 +98,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='profile-info-panel-content__badges'>
|
<div className='profile-info-panel-content__badges'>
|
||||||
{isAdmin(account) && <Badge slug='admin' title='Admin' />}
|
{this.getStaffBadge()}
|
||||||
{isModerator(account) && <Badge slug='moderator' title='Moderator' />}
|
|
||||||
{account.getIn(['patron', 'is_patron']) && <Badge slug='patron' title='Patron' />}
|
{account.getIn(['patron', 'is_patron']) && <Badge slug='patron' title='Patron' />}
|
||||||
{account.get('acct').includes('@') || <div className='profile-info-panel-content__badges__join-date'>
|
{account.get('acct').includes('@') || <div className='profile-info-panel-content__badges__join-date'>
|
||||||
<Icon id='calendar' />
|
<Icon id='calendar' />
|
||||||
|
|
Ładowanie…
Reference in New Issue