Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { BrowserRouter, Link } from 'react-router-dom';
  4. import { Route } from 'react-router';
  5. import LoginPage from '../LoginPage/LoginPage';
  6.  
  7. const SignUpForm = (
  8. {
  9. onSubmit,
  10. onChange,
  11. errors,
  12. instructor,
  13. }
  14. ) => (
  15. <form action="/" onSubmit={onSubmit}>
  16. <div className="container">
  17. <h2 className="sign-up">Sign Up</h2>
  18. <div className="field-line">
  19. <label htmlFor="fullName">Full Name:</label>
  20. <input
  21. id="fullName"
  22. name="fullName"
  23. onChange={onChange}
  24. value={instructor.fullName}
  25. />
  26. </div>
  27. <div className="field-line">
  28. <label htmlFor="username">Username:</label>
  29. <input
  30. id="username"
  31. name="username"
  32. onChange={onChange}
  33. value={instructor.username}
  34. />
  35. </div>
  36. <div className="field-line">
  37. <label htmlFor="password">Password:</label>
  38. <input
  39. id="password"
  40. name="password"
  41. onChange={onChange}
  42. value={instructor.password}
  43. />
  44. </div>
  45. <div className="button-line">
  46. <button type="submit" className="sign-up-button">
  47. Create New Account
  48. </button>
  49. </div>
  50.  
  51. <div className="login-redirect">
  52. Already have an account? <Link to={'/login'}> Log in</Link>
  53. </div>
  54. </div>
  55. <Route path="/login" component={LoginPage} />
  56. </form>
  57. );
  58.  
  59. SignUpForm.propTypes = {
  60. onSubmit: PropTypes.func.isRequired,
  61. onChange: PropTypes.func.isRequired,
  62. errors: PropTypes.object.isRequired,
  63. instructor: PropTypes.object.isRequired
  64. };
  65.  
  66. export default SignUpForm;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement