diff --git a/app/soapbox/components/sidebar_menu.js b/app/soapbox/components/sidebar_menu.js index 86d8af697..bfd5b9b99 100644 --- a/app/soapbox/components/sidebar_menu.js +++ b/app/soapbox/components/sidebar_menu.js @@ -284,10 +284,17 @@ class SidebarMenu extends ImmutablePureComponent { {intl.formatMessage(messages.preferences)} )} - - - {intl.formatMessage(messages.import_data)} - + {features.importAPI ? ( + + + {intl.formatMessage(messages.import_data)} + + ) : ( + + + {intl.formatMessage(messages.import_data)} + + )} {(features.federating && features.accountAliasesAPI) && {intl.formatMessage(messages.account_aliases)} diff --git a/app/soapbox/features/ui/components/link_footer.js b/app/soapbox/features/ui/components/link_footer.js index 6ea917cf2..ed89dc8dd 100644 --- a/app/soapbox/features/ui/components/link_footer.js +++ b/app/soapbox/features/ui/components/link_footer.js @@ -6,19 +6,22 @@ import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import { openModal } from '../../../actions/modal'; import { logOut } from 'soapbox/actions/auth'; -import { isAdmin } from 'soapbox/utils/accounts'; +import { getBaseURL, isAdmin } from 'soapbox/utils/accounts'; import sourceCode from 'soapbox/utils/code'; import { getFeatures } from 'soapbox/utils/features'; const mapStateToProps = state => { const me = state.get('me'); + const account = state.getIn(['accounts', me]); const instance = state.get('instance'); const features = getFeatures(instance); return { - account: state.getIn(['accounts', me]), + account, federating: features.federating, showAliases: features.accountAliasesAPI, + importAPI: features.importAPI, + baseURL: getBaseURL(account), }; }; @@ -32,7 +35,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ }, }); -const LinkFooter = ({ onOpenHotkeys, account, federating, showAliases, onClickLogOut }) => ( +const LinkFooter = ({ onOpenHotkeys, account, federating, showAliases, importAPI, onClickLogOut, baseURL }) => (
    {account && <> @@ -44,7 +47,11 @@ const LinkFooter = ({ onOpenHotkeys, account, federating, showAliases, onClickLo {isAdmin(account) &&
  • } {isAdmin(account) &&
  • }
  • -
  • +
  • {importAPI ? ( + + ) : ( + + )}
  • {(federating && showAliases) &&
  • }
  • } @@ -70,8 +77,10 @@ LinkFooter.propTypes = { account: ImmutablePropTypes.map, federating: PropTypes.bool, showAliases: PropTypes.bool, + importAPI: PropTypes.bool, onOpenHotkeys: PropTypes.func.isRequired, onClickLogOut: PropTypes.func.isRequired, + baseURL: PropTypes.string, }; export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(LinkFooter)); diff --git a/app/soapbox/utils/features.js b/app/soapbox/utils/features.js index 058eeec5b..e36892e76 100644 --- a/app/soapbox/utils/features.js +++ b/app/soapbox/utils/features.js @@ -44,6 +44,7 @@ export const getFeatures = createSelector([ emojiReactsRGI: v.software === PLEROMA && gte(v.version, '2.2.49'), attachmentLimit: v.software === PLEROMA ? Infinity : 4, focalPoint: v.software === MASTODON && gte(v.compatVersion, '2.3.0'), + importAPI: v.software === PLEROMA, importMutes: v.software === PLEROMA && gte(v.version, '2.2.0'), emailList: features.includes('email_list'), chats: v.software === PLEROMA && gte(v.version, '2.1.0'),