Ghost/ghost/members-auth-pages/components/FormInput.js
Fabien O'Carroll 1bad6dee4e Fixed linting for auth-pages
no-issue
2019-05-07 17:15:50 +02:00

26 lines
847 B
JavaScript

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