Merge branch 'suggestions-conditional-admin' into 'develop'

v2 Suggestions: conditionally display admin actions

See merge request soapbox-pub/soapbox-fe!893
This commit is contained in:
Alex Gleason 2021-11-27 05:54:36 +00:00
commit 3622300487

View file

@ -407,18 +407,20 @@ class Header extends ImmutablePureComponent {
});
}
if (account.getIn(['pleroma', 'is_suggested'])) {
menu.push({
text: intl.formatMessage(messages.unsuggestUser, { name: account.get('username') }),
action: this.props.onUnsuggestUser,
icon: require('@tabler/icons/icons/user-x.svg'),
});
} else {
menu.push({
text: intl.formatMessage(messages.suggestUser, { name: account.get('username') }),
action: this.props.onSuggestUser,
icon: require('@tabler/icons/icons/user-check.svg'),
});
if (features.suggestionsV2) {
if (account.getIn(['pleroma', 'is_suggested'])) {
menu.push({
text: intl.formatMessage(messages.unsuggestUser, { name: account.get('username') }),
action: this.props.onUnsuggestUser,
icon: require('@tabler/icons/icons/user-x.svg'),
});
} else {
menu.push({
text: intl.formatMessage(messages.suggestUser, { name: account.get('username') }),
action: this.props.onSuggestUser,
icon: require('@tabler/icons/icons/user-check.svg'),
});
}
}
if (account.get('id') !== me) {