import React, { PropTypes } from 'react'; import { Link } from 'react-router'; import * as UserActions from '../../User/actions'; import { bindActionCreators } from 'redux'; import { reduxForm } from 'redux-form'; import ResetPasswordForm from './ResetPasswordForm'; import classNames from 'classnames'; class ResetPasswordView extends React.Component { componentWillMount() { this.props.resetPasswordReset(); } componentDidMount() { this.refs.resetPassword.focus(); } render() { const resetPasswordClass = classNames({ 'reset-password': true, 'reset-password--submitted': this.props.user.resetPasswordInitiate }); return (

Reset Your Password

Your password reset email should arrive shortly. If you don't see it, check in your spam folder as sometimes it can end up there.

Login  or  Sign up

Cancel
); } } ResetPasswordView.propTypes = { resetPasswordReset: PropTypes.func.isRequired, user: PropTypes.shape({ resetPasswordInitiate: PropTypes.bool }).isRequired, }; function mapStateToProps(state) { return { user: state.user }; } function mapDispatchToProps(dispatch) { return bindActionCreators(UserActions, dispatch); } function validate(formProps) { const errors = {}; if (!formProps.email) { errors.email = 'Please enter an email'; } return errors; } export default reduxForm({ form: 'reset-password', fields: ['email'], validate }, mapStateToProps, mapDispatchToProps)(ResetPasswordView);