diff --git a/components/form/checkbox.js b/components/form/checkbox.js
index 9395b75..b3b718c 100644
--- a/components/form/checkbox.js
+++ b/components/form/checkbox.js
@@ -1,4 +1,4 @@
-import React from 'react'
+import React, {useEffect} from 'react'
import styles from './styles.module.css'
@@ -7,6 +7,11 @@ export default function Checkbox({label, error, hint, name, value, onChange, onB
onChange({target: {value: !value}})
}
+ useEffect(()=>{
+ if(value === "")
+ onChange({target: {value: false}})
+ }, [])
+
return (
diff --git a/components/form/decimalInput.js b/components/form/decimalInput.js
index 12e4b4b..16fffb4 100644
--- a/components/form/decimalInput.js
+++ b/components/form/decimalInput.js
@@ -86,7 +86,7 @@ export default function Input({label, prefix, numDecimals, error, hint, name, va
{remainingText}
- {hint && {error || (isValid ? '' : hint)}}
+ {(hint || error) && {error || (isValid ? '' : hint)}}
)
}
diff --git a/components/form/input.js b/components/form/input.js
index 325ebd8..f436034 100644
--- a/components/form/input.js
+++ b/components/form/input.js
@@ -2,14 +2,14 @@ import React from 'react'
import styles from './styles.module.css'
-export default function Input({_label, error, hint, type, name, value, onChange, onBlur, isValid}){
+export default function Input({label: _label, error, hint, type, name, value, onChange, onBlur, isValid}){
const label = _label || name.replace(name[0], name[0].toUpperCase())
return (
- {hint && {error || (isValid ? '' : hint)}}
+ {(hint || error) && {error || (isValid ? '' : hint)}}
)
}
diff --git a/pages/admin/items/index.js b/pages/admin/items/index.js
index 6f6a9f8..341bd8f 100644
--- a/pages/admin/items/index.js
+++ b/pages/admin/items/index.js
@@ -31,6 +31,7 @@ export default function Items({items: _items}){
return (
<>
Items
+ Create New Item