import React from 'react'; import PropTypes from 'prop-types'; import styles from './ForgotPassword.css'; import { Button, TextField } from 'plugin-api/beta/client/components/ui'; import { t } from 'plugin-api/beta/client/services'; class ForgotPassword extends React.Component { handleSignUpLink = e => { e.preventDefault(); this.props.onSignUpLink(); }; handleSignInLink = e => { e.preventDefault(); this.props.onSignInLink(); }; handleEmailChange = e => this.props.onEmailChange(e.target.value); handleSubmit = e => { e.preventDefault(); this.props.onSubmit(); }; render() { const { email, errorMessage, success } = this.props; return (

{t('talk-plugin-auth.login.recover_password')}

{success ? (

{t('password_reset.mail_sent')}

) : null} {errorMessage ? (

{errorMessage}

) : null}
{t('talk-plugin-auth.login.need_an_account')}{' '} {t('talk-plugin-auth.login.register')} {t('talk-plugin-auth.login.already_have_an_account')}{' '} {t('talk-plugin-auth.login.sign_in')}
); } } ForgotPassword.propTypes = { success: PropTypes.bool.isRequired, email: PropTypes.string.isRequired, onEmailChange: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired, errorMessage: PropTypes.string, onSignInLink: PropTypes.func.isRequired, onSignUpLink: PropTypes.func.isRequired, }; export default ForgotPassword;