Skip to content

Instantly share code, notes, and snippets.

@crobinson42
Created September 8, 2018 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crobinson42/2a4132c61825af8f3bf4faa3fe9f0b57 to your computer and use it in GitHub Desktop.
Save crobinson42/2a4132c61825af8f3bf4faa3fe9f0b57 to your computer and use it in GitHub Desktop.
<Form
onSubmit={props.handleSubmit}
render={({ handleSubmit, submitting, submitError, values }) => (
<form
className="col-md-8 offset-md-2 col-xs-12 text-center"
onSubmit={handleSubmit}
>
<Field name="email" validate={formValidate.required}>
{({ input, meta }) => (
<div>
<input
{...input}
className="form-control"
placeholder="Email or Username"
type="text"
/>
<FormFieldError {...meta} />
</div>
)}
</Field>
<Field name="password" validate={formValidate.required}>
{({ input, meta }) => (
<div>
<input
{...input}
className="form-control"
placeholder="Password"
type="password"
/>
<FormFieldError {...meta} />
</div>
)}
</Field>
{/*<Field name="terms" validate={formValidate.required}>*/}
{/*{({ input, meta }) => (*/}
{/*<div className="pt-2 text-center">*/}
{/*<input*/}
{/*{...input}*/}
{/*id="terms"*/}
{/*type="checkbox"*/}
{/*/>*/}
{/*<label className="small text-muted" htmlFor="terms">*/}
{/*{' '}*/}
{/*I agree to the <a href="/terms_and_conditions">terms & conditions</a>*/}
{/*</label>*/}
{/*</div>*/}
{/*)}*/}
{/*</Field>*/}
{!submitting &&
submitError && (
<div className="alert alert-danger m-3">{submitError}</div>
)}
<div className="m-3">
<button
className="btn btn-primary btn-login"
disabled={submitting}
>
{submitting ? (<div style={{ height: '25px' }}><Loading /></div>) : 'Login'}
</button>
</div>
<div className="p-3 text-center">
<button
className="btn btn-link"
disabled={submitting}
onClick={() => this.context.setStep('ForgotPassword')}
>
Forgot Password
</button>
</div>
</form>
)}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment