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'; // FIXME: Let this be configured const sourceCode = { name: 'soapbox-fe', url: 'https://gitlab.com/soapbox-pub/soapbox-fe', repository: 'soapbox-pub/soapbox-fe', version: '1.0.0', }; const mapStateToProps = state => { const me = state.get('me'); return { account: state.getIn(['accounts', me]), }; }; const mapDispatchToProps = (dispatch) => ({ onOpenHotkeys() { dispatch(openModal('HOTKEYS')); }, onClickLogOut(e) { dispatch(logOut()); 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));