diff --git a/app/soapbox/components/sidebar_menu.js b/app/soapbox/components/sidebar_menu.js index 82eaba8f5..8bbde589d 100644 --- a/app/soapbox/components/sidebar_menu.js +++ b/app/soapbox/components/sidebar_menu.js @@ -19,6 +19,7 @@ import ThemeToggle from '../features/ui/components/theme_toggle_container'; import { fetchOwnAccounts } from 'soapbox/actions/auth'; import { is as ImmutableIs } from 'immutable'; import { getSoapboxConfig } from 'soapbox/actions/soapbox'; +import { getFeatures } from 'soapbox/utils/features'; const messages = defineMessages({ followers: { id: 'account.followers', defaultMessage: 'Followers' }, @@ -53,6 +54,9 @@ const makeMapStateToProps = () => { const mapStateToProps = state => { const me = state.get('me'); + const instance = state.get('instance'); + + const features = getFeatures(instance); const soapbox = getSoapboxConfig(state); return { @@ -61,6 +65,7 @@ const makeMapStateToProps = () => { donateUrl: state.getIn(['patron', 'instance', 'url']), hasCrypto: typeof soapbox.getIn(['cryptoAddresses', 0, 'ticker']) === 'string', otherAccounts: getOtherAccounts(state), + features, }; }; @@ -93,6 +98,7 @@ class SidebarMenu extends ImmutablePureComponent { otherAccounts: ImmutablePropTypes.list, sidebarOpen: PropTypes.bool, onClose: PropTypes.func.isRequired, + features: PropTypes.object.isRequired, }; state = { @@ -149,7 +155,7 @@ class SidebarMenu extends ImmutablePureComponent { } render() { - const { sidebarOpen, intl, account, onClickLogOut, donateUrl, otherAccounts, hasCrypto } = this.props; + const { sidebarOpen, intl, account, onClickLogOut, donateUrl, otherAccounts, hasCrypto, features } = this.props; const { switcher } = this.state; if (!account) return null; const acct = account.get('acct'); @@ -231,10 +237,10 @@ class SidebarMenu extends ImmutablePureComponent { {intl.formatMessage(messages.blocks)} - + {features.federating && {intl.formatMessage(messages.domain_blocks)} - + } {intl.formatMessage(messages.mutes)} @@ -259,10 +265,10 @@ class SidebarMenu extends ImmutablePureComponent { {intl.formatMessage(messages.import_data)} - + {(features.federating && features.accountAliasesAPI) && {intl.formatMessage(messages.account_aliases)} - + } {intl.formatMessage(messages.security)}