2016-10-12 18:25:24 +00:00
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
|
|
|
|
function ResetPasswordForm(props) {
|
|
|
|
const { fields: { email }, handleSubmit, submitting, invalid, pristine } = props;
|
|
|
|
return (
|
|
|
|
<form className="reset-password-form" onSubmit={handleSubmit(props.initiateResetPassword.bind(this))}>
|
|
|
|
<p className="reset-password-form__field">
|
|
|
|
<input
|
|
|
|
className="reset-password-form__email-input"
|
|
|
|
aria-label="email"
|
|
|
|
type="text"
|
|
|
|
placeholder="Email used for registration"
|
|
|
|
{...email}
|
|
|
|
/>
|
|
|
|
</p>
|
2016-10-12 21:19:43 +00:00
|
|
|
<input type="submit" disabled={submitting || invalid || pristine} value="Send password reset email" aria-label="Send email to reset password" />
|
2016-10-12 18:25:24 +00:00
|
|
|
</form>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-10-12 21:19:43 +00:00
|
|
|
ResetPasswordForm.propTypes = {
|
2016-10-12 18:25:24 +00:00
|
|
|
fields: PropTypes.shape({
|
|
|
|
email: PropTypes.object.isRequired
|
|
|
|
}).isRequired,
|
|
|
|
handleSubmit: PropTypes.func.isRequired,
|
|
|
|
initiateResetPassword: PropTypes.func.isRequired,
|
|
|
|
submitting: PropTypes.bool,
|
|
|
|
invalid: PropTypes.bool,
|
|
|
|
pristine: PropTypes.bool
|
2016-10-12 21:19:43 +00:00
|
|
|
};
|
2016-10-12 18:25:24 +00:00
|
|
|
|
|
|
|
export default ResetPasswordForm;
|