RegistrationForm.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import React from 'react'
  2. import { Field, reduxForm } from 'redux-form';
  3. import './registrationForm.scss';
  4. let RegistrationForm = props => {
  5. const { handleSubmit, postCheckInSubmit } = props;
  6. const submit = value => {
  7. console.log(value);
  8. postCheckInSubmit(value);
  9. };
  10. return (
  11. <form className="form" onSubmit={handleSubmit(submit)}>
  12. <div>
  13. <label htmlFor="name">Full name</label>
  14. <Field name="name" component="input" type="text" id="name"/>
  15. </div>
  16. <div>
  17. <label htmlFor="male">male</label>
  18. <Field name="sex" component="input" type="radio" id="male" value="male" checked="checked"/>
  19. <label htmlFor="female">female</label>
  20. <Field name="sex" component="input" type="radio" id="female" value="female"/>
  21. </div>
  22. <div>
  23. <label htmlFor="phone">Phone</label>
  24. <Field name="phone" component="input" type="phone" id="phone"/>
  25. </div>
  26. <div>
  27. <label htmlFor="email">E-mail</label>
  28. <Field name="email" component="input" type="email" id="email"/>
  29. </div>
  30. <div>
  31. <label htmlFor="password">Password</label>
  32. <Field name="password" component="input" type="text" id="password"/>
  33. </div>
  34. <div>
  35. <label htmlFor="confirmPassword">Confirm Password</label>
  36. <Field name="confirmPassword" component="input" type="text" id="confirmPassword"/>
  37. </div>
  38. <button type="submit">Check in</button>
  39. </form>
  40. )
  41. };
  42. RegistrationForm = reduxForm({
  43. form: 'registration'
  44. })(RegistrationForm)
  45. export default RegistrationForm