settingsForm.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import React from 'react'
  2. import { Field, reduxForm } from 'redux-form';
  3. import './settings-form.scss';
  4. import { customInput } from "../customFields/customInput/customInput";
  5. let SettingsForm = props => {
  6. //const { handleSubmit, postCheckInSubmit } = props;
  7. const { handleSubmit, initialValues } = props;
  8. console.log('initialValues',initialValues);
  9. console.log(props)
  10. const onChangeValue = e => {
  11. console.log(e.target.value);
  12. }
  13. const submit = value => {
  14. console.log(value);
  15. //postCheckInSubmit(value);
  16. };
  17. return (
  18. <form className="form" onSubmit={handleSubmit(submit)}>
  19. <div>
  20. {/*<label htmlFor="name">Name</label>*/}
  21. {/*<input name="name" type="text" id="name" value={userInfo.name}/>*/}
  22. <Field name="name" component={customInput} id="name" label="Name" onChange={onChangeValue}/>
  23. </div>
  24. <div>
  25. {/*<label htmlFor="phone">Phone</label>*/}
  26. <Field name="phone" component={customInput} type="phone" id="phone" label="Phone" onChange={onChangeValue}/>
  27. </div>
  28. {/*<div>
  29. <label htmlFor="email">E-mail</label>
  30. <Field name="email" component="input" type="email" id="email"/>
  31. </div>
  32. <div>
  33. <label htmlFor="password">Password</label>
  34. <Field name="password" component="input" type="text" id="password"/>
  35. </div>
  36. <div>
  37. <label htmlFor="confirmPassword">Confirm Password</label>
  38. <Field name="confirmPassword" component="input" type="text" id="confirmPassword"/>
  39. </div>*/}
  40. <button type="submit" className="btn">Save</button>
  41. </form>
  42. )
  43. };
  44. SettingsForm = reduxForm({
  45. form: 'settings'
  46. })(SettingsForm)
  47. export default SettingsForm