Merge branch 'list-decoupling' into 'master'

Always show 'Add or Remove from lists' menu item for Pleroma users

See merge request soapbox-pub/soapbox-fe!23
merge-requests/24/head
Alex Gleason 2020-05-26 16:52:44 +00:00
commit 96b9d59d49
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import Button from 'gabsocial/components/button';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { isStaff } from 'gabsocial/utils/accounts';
import { parseVersion } from 'gabsocial/utils/features';
import classNames from 'classnames';
import Avatar from 'gabsocial/components/avatar';
import { shortNumberFormat } from 'gabsocial/utils/numbers';
@ -54,6 +55,7 @@ const mapStateToProps = state => {
me,
isStaff: isStaff(state.getIn(['accounts', me])),
autoPlayGif: getSettings(state).get('autoPlayGif'),
version: parseVersion(state.getIn(['instance','version'])),
};
};
@ -70,6 +72,7 @@ class Header extends ImmutablePureComponent {
username: PropTypes.string,
autoPlayGif: PropTypes.bool,
isStaff: PropTypes.bool.isRequired,
version: PropTypes.node,
};
static defaultProps = {
@ -103,7 +106,7 @@ class Header extends ImmutablePureComponent {
});
makeMenu() {
const { account, intl, me, isStaff } = this.props;
const { account, intl, me, isStaff, version } = this.props;
let menu = [];
@ -138,6 +141,9 @@ class Header extends ImmutablePureComponent {
menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle });
menu.push(null);
}
else if (version.software === 'Pleroma') {
menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });
}
if (account.getIn(['relationship', 'muting'])) {
menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });