authRenderField.js 616 B

1234567891011
  1. import React from "react";
  2. export const authRenderField = ({input, meta: {touched, error}, label, type, placeholder }) => (
  3. <div className={touched && error ? "form__input-box":"error"}>
  4. <label className="form__input-label" htmlFor="origin">
  5. {label}
  6. {touched && error ? <input className="input" style={{"border":"2px solid red"}} type = {type} placeholder = {placeholder} {...input} /> : <input className="input" type = {type} placeholder = {placeholder} {...input} /> }
  7. </label>
  8. {touched && error && <span className="span_auth">{error}</span>}
  9. </div>
  10. );