input.js 375 B

12345678910111213
  1. import React from 'react';
  2. export default ({ id, label, type = "text", fail, touch, ...rest }) => (
  3. <label htmlFor={id} className="input-box">
  4. {label}
  5. <input
  6. className={fail && touch ? 'input-box__input input-box__input--fail' : 'input-box__input'}
  7. id={id}
  8. type={type}
  9. {...rest}
  10. />
  11. </label>
  12. );