Added support for disabled form elements

no-issue

This can be used for a coupon input in future
This commit is contained in:
Fabien O'Carroll 2019-04-16 19:03:18 +02:00
parent 88368d0d94
commit b28f3a02d9

View File

@ -1,4 +1,4 @@
export default ({type, name, placeholder, value = '', error, onInput, required, className, children, icon}) => ( export default ({type, name, placeholder, value = '', error, onInput, required, disabled, className, children, icon}) => (
<div className="gm-form-element"> <div className="gm-form-element">
<div className={[ <div className={[
(className ? className : ""), (className ? className : ""),
@ -12,6 +12,7 @@ export default ({type, name, placeholder, value = '', error, onInput, required,
value={ value } value={ value }
onInput={ (e) => onInput(e, name) } onInput={ (e) => onInput(e, name) }
required={ required } required={ required }
disabled={ disabled }
className={[ className={[
(value ? "gm-input-filled" : ""), (value ? "gm-input-filled" : ""),
(error ? "gm-error" : "") (error ? "gm-error" : "")