mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 07:51:55 +03:00
5b063659d0
no-issue This can be used for a coupon input in future
26 lines
857 B
JavaScript
26 lines
857 B
JavaScript
export default ({type, name, placeholder, value = '', error, onInput, required, disabled, 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>
|
|
);
|