e87390adb9
* update eslint and dependencies, fix linting errors that can be fixed with --fix * fix lots of linting errors * update eslintrc, fix some linting errors * fix all server side linting errors, untested * fix errors that fixing linting errors had caused * fix client side eslint errors * fix client side linting errors * fix refs lint errors * fix more linting errors * update eslint and dependencies, fix linting errors that can be fixed with --fix * fix lots of linting errors * update eslintrc, fix some linting errors * fix all server side linting errors, untested * fix errors that fixing linting errors had caused * fix client side eslint errors * fix client side linting errors * fix refs lint errors * fix more linting errors * fix some accessibility linting errors * fix a lot of linting errors * fix a billion more linting errors * hopefully fix all linting errors, still need to test * fix bugs that fixing linting had caused
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import React, { PropTypes } from 'react';
|
|
import { domOnlyProps } from '../../../utils/reduxFormUtils';
|
|
|
|
function ResetPasswordForm(props) {
|
|
const { fields: { email }, handleSubmit, submitting, invalid, pristine } = props;
|
|
return (
|
|
<form className="form" onSubmit={handleSubmit(props.initiateResetPassword.bind(this))}>
|
|
<p className="form__field">
|
|
<label htmlFor="email" className="form__label">Email used for registration</label>
|
|
<input
|
|
className="form__input"
|
|
aria-label="email"
|
|
type="text"
|
|
id="email"
|
|
{...domOnlyProps(email)}
|
|
/>
|
|
</p>
|
|
<input type="submit" disabled={submitting || invalid || pristine || props.user.resetPasswordInitiate} value="Send Password Reset Email" aria-label="Send email to reset password" />
|
|
</form>
|
|
);
|
|
}
|
|
|
|
ResetPasswordForm.propTypes = {
|
|
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,
|
|
user: PropTypes.shape({
|
|
resetPasswordInitiate: PropTypes.bool
|
|
}).isRequired
|
|
};
|
|
|
|
ResetPasswordForm.defaultProps = {
|
|
submitting: false,
|
|
pristine: true,
|
|
invalid: false
|
|
};
|
|
|
|
export default ResetPasswordForm;
|