|
@@ -8,34 +8,34 @@ import { Link } from 'react-router-dom'
|
|
import * as routes from './../../../../constants/routes'
|
|
import * as routes from './../../../../constants/routes'
|
|
|
|
|
|
class Form extends React.Component {
|
|
class Form extends React.Component {
|
|
- sendRequest = values => {
|
|
|
|
- const { actions: { signInRequest } } = this.props;
|
|
|
|
- signInRequest(values);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- render() {
|
|
|
|
- const { invalid, handleSubmit, submitting, requestError } = this.props;
|
|
|
|
-
|
|
|
|
- return (
|
|
|
|
- <form className="sign-form" onSubmit={handleSubmit(this.sendRequest)}>
|
|
|
|
- <h2 className="sign-form__header">Sign In</h2>
|
|
|
|
-
|
|
|
|
- {requestError && <p className="error-line error-line--warn error-line--no-margin">{requestError}</p>}
|
|
|
|
-
|
|
|
|
- <Field className="sign-form__input sign-form__input--text" placeholder="Login" name="login" component={formInput} type="text" />
|
|
|
|
- <Field className="sign-form__input sign-form__input--password" placeholder="Password" name="password" component={formInput} type="password" />
|
|
|
|
-
|
|
|
|
- <button className="link--btn link--btn60" disabled={invalid || submitting}>Sign In</button>
|
|
|
|
-
|
|
|
|
- <p className="sign-form__link--forgot-password"><Link className="link--inline" to={routes.PASSWORD_FORGET}>Forgot password ?</Link></p>
|
|
|
|
- <hr className="sign-form__divider" />
|
|
|
|
- <p className="sign-form__link--sign-up">Still ain't got an account? <Link className="link--inline" to={routes.SIGN_UP}>Sign up</Link> first!</p>
|
|
|
|
- </form>
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
|
|
+ sendRequest = values => {
|
|
|
|
+ const { actions: { signInRequest } } = this.props;
|
|
|
|
+ signInRequest(values);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ render() {
|
|
|
|
+ const { invalid, handleSubmit, submitting, requestError } = this.props;
|
|
|
|
+
|
|
|
|
+ return (
|
|
|
|
+ <form className="sign-form" onSubmit={handleSubmit(this.sendRequest)}>
|
|
|
|
+ <h2 className="sign-form__header">Sign In</h2>
|
|
|
|
+
|
|
|
|
+ {requestError && <p className="error-line error-line--warn error-line--no-margin">{requestError}</p>}
|
|
|
|
+
|
|
|
|
+ <Field className="sign-form__input sign-form__input--text" placeholder="Login" name="login" component={formInput} type="text" />
|
|
|
|
+ <Field className="sign-form__input sign-form__input--password" placeholder="Password" name="password" component={formInput} type="password" />
|
|
|
|
+
|
|
|
|
+ <button className="link--btn link--btn60" disabled={invalid || submitting}>Sign In</button>
|
|
|
|
+
|
|
|
|
+ <p className="sign-form__link--forgot-password"><Link className="link--inline" to={routes.PASSWORD_FORGET}>Forgot password ?</Link></p>
|
|
|
|
+ <hr className="sign-form__divider" />
|
|
|
|
+ <p className="sign-form__link--sign-up">Still ain't got an account? <Link className="link--inline" to={routes.SIGN_UP}>Sign up</Link> first!</p>
|
|
|
|
+ </form>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
export default reduxForm({
|
|
export default reduxForm({
|
|
- form: "signIn",
|
|
|
|
- validate
|
|
|
|
|
|
+ form: "signIn",
|
|
|
|
+ validate
|
|
})(Form)
|
|
})(Form)
|