From 4c82b4703b2d93a673b02ba674f444fa4ac305d4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 13 Jul 2021 11:21:37 -0500 Subject: [PATCH] ProfileInfoPanel: avoid redundant staff badge If the user is an admin, don't display the moderator badge --- .../features/ui/components/profile_info_panel.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/ui/components/profile_info_panel.js b/app/soapbox/features/ui/components/profile_info_panel.js index c32bfc42e..4b5559bfd 100644 --- a/app/soapbox/features/ui/components/profile_info_panel.js +++ b/app/soapbox/features/ui/components/profile_info_panel.js @@ -46,6 +46,18 @@ class ProfileInfoPanel extends ImmutablePureComponent { displayFqn: PropTypes.bool, }; + getStaffBadge = () => { + const { account } = this.props; + + if (isAdmin(account)) { + return ; + } else if (isModerator(account)) { + return ; + } else { + return null; + } + } + render() { const { account, displayFqn, intl, identity_proofs, username } = this.props; @@ -86,8 +98,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
- {isAdmin(account) && } - {isModerator(account) && } + {this.getStaffBadge()} {account.getIn(['patron', 'is_patron']) && } {account.get('acct').includes('@') ||