Ghost/ghost/members-api/static/auth/components/FormInput.js
2019-05-07 17:35:17 +02:00

23 lines
746 B
JavaScript

export default ({type, name, placeholder, value = '', error, onInput, required, className, children, icon}) => (
<div className="gm-form-element">
<div className="gm-input">
<input
type={ type }
name={ name }
key={ name }
placeholder={ placeholder }
value={ value }
onInput={ (e) => onInput(e, name) }
required={ required }
className={[
(value ? "gm-input-filled" : ""),
(error ? "gm-error" : ""),
className
].join(' ')}
/>
<i>{ icon }</i>
{ children }
</div>
</div>
);