2016-06-27 18:00:45 +00:00
|
|
|
import React, { PropTypes } from 'react';
|
2016-06-23 22:29:55 +00:00
|
|
|
|
2016-06-27 18:00:45 +00:00
|
|
|
function LoginForm(props) {
|
|
|
|
const { fields: { email, password }, handleSubmit } = props;
|
|
|
|
return (
|
|
|
|
<form className="login-form" onSubmit={handleSubmit(props.loginUser.bind(this))}>
|
|
|
|
<p className="login-form__field">
|
|
|
|
<input
|
|
|
|
className="login-form__email-input"
|
2016-08-01 01:38:46 +00:00
|
|
|
aria-label="email"
|
2016-06-27 18:00:45 +00:00
|
|
|
type="text"
|
|
|
|
placeholder="Email"
|
|
|
|
{...email}
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
<p className="login-form__field">
|
|
|
|
<input
|
|
|
|
className="signup-form__password-input"
|
2016-08-01 01:38:46 +00:00
|
|
|
aria-label="password"
|
2016-06-27 18:00:45 +00:00
|
|
|
type="password"
|
|
|
|
placeholder="Password"
|
|
|
|
{...password}
|
|
|
|
/>
|
|
|
|
</p>
|
2016-08-01 01:38:46 +00:00
|
|
|
<input type="submit" value="Login" aria-label="login" />
|
2016-06-27 18:00:45 +00:00
|
|
|
</form>
|
|
|
|
);
|
2016-06-23 22:29:55 +00:00
|
|
|
}
|
|
|
|
|
2016-06-27 18:00:45 +00:00
|
|
|
LoginForm.propTypes = {
|
|
|
|
fields: PropTypes.shape({
|
2016-06-27 20:14:26 +00:00
|
|
|
email: PropTypes.string.isRequired,
|
2016-06-27 18:00:45 +00:00
|
|
|
password: PropTypes.string.isRequired
|
|
|
|
}).isRequired,
|
|
|
|
handleSubmit: PropTypes.func.isRequired,
|
|
|
|
loginUser: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
2016-06-23 22:29:55 +00:00
|
|
|
export default LoginForm;
|