import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage, injectIntl } from 'react-intl'; import { Link } from 'react-router-dom'; import { invitesEnabled, version, repository, source_url } from 'gabsocial/initial_state'; import { connect } from 'react-redux'; import { openModal } from '../../../actions/modal'; import { logOut } from 'gabsocial/actions/auth'; const mapStateToProps = state => { const me = state.get('me'); return { account: state.getIn(['accounts', me]), siteTitle: state.getIn(['instance', 'title']), } }; const mapDispatchToProps = (dispatch) => ({ onOpenHotkeys() { dispatch(openModal('HOTKEYS')); }, onClickLogOut(e) { dispatch(logOut()); e.preventDefault(); }, }); const LinkFooter = ({ onOpenHotkeys, account, siteTitle, onClickLogOut }) => (

{repository} (v{version}) }} />

); LinkFooter.propTypes = { withHotkeys: PropTypes.bool, }; export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(LinkFooter));