flex-template-web/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js
2017-06-16 15:38:17 +03:00

25 lines
1,014 B
JavaScript

import React from 'react';
import { Field, reduxForm, propTypes as formPropTypes } from 'redux-form';
import { Button } from '../../components';
const ChangeAccountPasswordForm = props => {
const { handleSubmit, pristine, submitting } = props;
return (
<form onSubmit={handleSubmit}>
<label htmlFor="newPassword1">New password</label>
<Field name="newPassword1" component="input" type="password" />
<label htmlFor="newPassword2">New password, again</label>
<Field name="newPassword2" component="input" type="password" />
<label htmlFor="password">Current password</label>
<Field name="password" component="input" type="password" />
<p>Delete account (module)</p>
<Button type="submit" disabled={pristine || submitting}>Save changes</Button>
</form>
);
};
ChangeAccountPasswordForm.propTypes = { ...formPropTypes };
const defaultFormName = 'ChangeAccountPasswordForm';
export default reduxForm({ form: defaultFormName })(ChangeAccountPasswordForm);