import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { FormattedMessage, injectIntl } from 'react-intl'; 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 sourceCode from 'soapbox/utils/code'; import { getFeatures } from 'soapbox/utils/features'; const mapStateToProps = state => { const me = state.get('me'); const instance = state.get('instance'); const features = getFeatures(instance); return { account: state.getIn(['accounts', me]), federating: features.federating, showAliases: features.accountAliasesAPI, }; }; const mapDispatchToProps = (dispatch, { intl }) => ({ onOpenHotkeys() { dispatch(openModal('HOTKEYS')); }, onClickLogOut(e) { dispatch(logOut(intl)); e.preventDefault(); }, }); const LinkFooter = ({ onOpenHotkeys, account, federating, showAliases, onClickLogOut }) => (
); LinkFooter.propTypes = { account: ImmutablePropTypes.map, federating: PropTypes.bool, showAliases: PropTypes.bool, onOpenHotkeys: PropTypes.func.isRequired, onClickLogOut: PropTypes.func.isRequired, }; export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(LinkFooter));