import PropTypes from 'prop-types'; import React from 'react'; import { Link } from 'react-router'; import { withTranslation } from 'react-i18next'; class ErrorModal extends React.Component { forceAuthentication() { return (

{this.props.t('ErrorModal.MessageLogin')} {this.props.t('ErrorModal.Login')} {this.props.t('ErrorModal.LoginOr')} {this.props.t('ErrorModal.SignUp')}.

); } staleSession() { return (

{this.props.t('ErrorModal.MessageLoggedOut')} {this.props.t('ErrorModal.LogIn')}.

); } staleProject() { return (

{this.props.t('ErrorModal.SavedDifferentWindow')}

); } render() { return (
{(() => { // eslint-disable-line if (this.props.type === 'forceAuthentication') { return this.forceAuthentication(); } else if (this.props.type === 'staleSession') { return this.staleSession(); } else if (this.props.type === 'staleProject') { return this.staleProject(); } })()}
); } } ErrorModal.propTypes = { type: PropTypes.string.isRequired, closeModal: PropTypes.func.isRequired, t: PropTypes.func.isRequired }; export default withTranslation()(ErrorModal);