diff -r f0f83f5530a6 -r c78d579f4b55 client/src/components/Reset.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/components/Reset.js Tue Dec 18 02:27:22 2018 +0100 @@ -0,0 +1,128 @@ +import React, { Component } from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; +import * as authActions from '../actions/authActions'; +import { Trans } from 'react-i18next'; +import * as R from 'ramda'; + +class Reset extends Component { + + constructor(props) { + super(props); + + this.state = { + email: '' + } + + + } + + reset = () => { + const { email } = this.state; + + this.props.authActions.resetSubmit(email); + } + + handleChange = (event) => { + const newState = {}; + newState[event.target.name] = event.target.value; + this.setState(newState); + } + + submit = (e) => { + e.preventDefault(); + + this.reset(); + } + + onClickLogin = (e) => { + e.preventDefault(); + this.props.history.push('/login'); + } + + renderErrorMessage(errorMessages, fieldname) { + if (errorMessages && fieldname in errorMessages) { + return errorMessages[fieldname].map((message, key) => +
{ message }
+ ); + } + } + + renderNonFieldErrors(errorMessages) { + + if (errorMessages && errorMessages.error) { + return ( +