Ghost/ghost/members-auth-pages/components/FormInput.js

26 lines
847 B
JavaScript
Raw Normal View History

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