p5.js-web-editor/client/modules/User/components/SignupForm.js

60 lines
1.7 KiB
JavaScript
Raw Normal View History

2016-06-27 19:54:50 +02:00
import React, { PropTypes } from 'react';
2016-06-24 00:29:55 +02:00
2016-06-27 19:54:50 +02:00
function SignupForm(props) {
const { fields: { username, email, password, confirmPassword }, handleSubmit } = props;
return (
<form className="signup-form" onSubmit={handleSubmit(props.signUpUser.bind(this))}>
<p className="signup-form__field">
<input
className="signup-form__username-input"
2016-08-01 03:38:46 +02:00
aria-label="username"
2016-06-27 19:54:50 +02:00
type="text"
placeholder="Username"
{...username}
/>
</p>
<p className="signup-form__field">
<input
className="signup-form__email-input"
2016-08-01 03:38:46 +02:00
aria-label="email"
2016-06-27 19:54:50 +02:00
type="text"
placeholder="Email"
{...email}
/>
</p>
<p className="signup-form__field">
<input
className="signup-form__password-input"
2016-08-01 03:38:46 +02:00
aria-label="password"
2016-06-27 19:54:50 +02:00
type="password"
placeholder="Password"
{...password}
/>
</p>
<p className="signup-form__field">
<input
className="signup-form__confirm-password-input"
type="password"
placeholder="Confirm Password"
2016-08-01 03:38:46 +02:00
aria-label="confirm password"
2016-06-27 19:54:50 +02:00
{...confirmPassword}
/>
</p>
2016-08-01 03:38:46 +02:00
<input type="submit" value="Sign Up" aria-label="sign up" />
2016-06-27 19:54:50 +02:00
</form>
);
2016-06-24 00:29:55 +02:00
}
2016-06-27 19:54:50 +02:00
SignupForm.propTypes = {
fields: PropTypes.shape({
username: PropTypes.string.isRequired,
email: PropTypes.string.isRequired,
password: PropTypes.string.isRequired,
confirmPassword: PropTypes.string.isRequired
}).isRequired,
handleSubmit: PropTypes.func.isRequired,
signUpUser: PropTypes.func.isRequired
};
2016-06-24 00:29:55 +02:00
export default SignupForm;