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'; const mapStateToProps = state => { const me = state.get('me'); return { account: state.getIn(['accounts', me]), }; }; const mapDispatchToProps = (dispatch, { intl }) => ({ onOpenHotkeys() { dispatch(openModal('HOTKEYS')); }, onClickLogOut(e) { dispatch(logOut(intl)); e.preventDefault(); }, }); const LinkFooter = ({ onOpenHotkeys, account, onClickLogOut }) => (

{sourceCode.repository}, code_version: sourceCode.version, }} />

); LinkFooter.propTypes = { account: ImmutablePropTypes.map, onOpenHotkeys: PropTypes.func.isRequired, onClickLogOut: PropTypes.func.isRequired, }; export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(LinkFooter));