flex-template-web/src/containers/ChangePasswordForm/ChangePasswordForm.js
Kimmo Puputti b9943f1b53 Change reduxForm call form argument name
- Since the form name can be overriden with component props, the
   initial name is just a default, this changes the var name to
   communicate that

Note: The names of the forms with selectors cannot be changed,
otherwise the selector doesn't find the correct data from the Redux
store with the initial form name.
2017-05-08 14:59:09 +03:00

22 lines
866 B
JavaScript

import React from 'react';
import { Field, reduxForm, propTypes as formPropTypes } from 'redux-form';
import { Button, Input } from '../../components';
const ChangePasswordForm = props => {
const { handleSubmit, pristine, submitting } = props;
return (
<form onSubmit={handleSubmit}>
<label htmlFor="newPassword1">New password</label>
<Field name="newPassword1" component={Input.fieldComponent} type="password" />
<label htmlFor="newPassword2">New password, again</label>
<Field name="newPassword2" component={Input.fieldComponent} type="password" />
<Button type="submit" disabled={pristine || submitting}>Change password</Button>
</form>
);
};
ChangePasswordForm.propTypes = { ...formPropTypes };
const defaultFormName = 'ChangePasswordForm';
export default reduxForm({ form: defaultFormName })(ChangePasswordForm);