aboutsummaryrefslogtreecommitdiff
path: root/src/components/editors
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/editors')
-rw-r--r--src/components/editors/item-editor.js10
-rw-r--r--src/components/editors/scss/item-editor.scss10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/components/editors/item-editor.js b/src/components/editors/item-editor.js
index d72cff3..be0ac4f 100644
--- a/src/components/editors/item-editor.js
+++ b/src/components/editors/item-editor.js
@@ -32,6 +32,7 @@ const ItemEditor = (props) => {
const [maxQty, setMaxQty] = useState(props.item.MaxQuantity);
const [brand, setBrand] = useState(props.item.Brand);
const [savedBrands, setSavedBrands] = useState([]);
+ const [hasDecimalQty, setHasDecimalQty] = useState(props.item.HasDecimalQuantity);
// get saved brands from API
// needed by the brands dropdown menu
@@ -66,6 +67,7 @@ const ItemEditor = (props) => {
item.MinQuantity = minQuantity;
item.MaxQuantity = maxQuantity;
item.Brand = brand;
+ item.HasDecimalQuantity = hasDecimalQty;
// TODO: Save is for new items. implement modification too
props.editing
@@ -189,6 +191,14 @@ const ItemEditor = (props) => {
</label>
}
+ <label className={"checkbox-label"}>
+ <input
+ type="checkbox"
+ checked={hasDecimalQty}
+ onChange={() => setHasDecimalQty(i => !i)} />
+ Quantity may contain decimal places
+ </label>
+
<span className={"buttons"}>
<input type="button" value="Clear" onClick={clearAll}/>
<input type="button" value="Cancel" onClick={handleCancel}/>
diff --git a/src/components/editors/scss/item-editor.scss b/src/components/editors/scss/item-editor.scss
index 8f60ec7..4d4d016 100644
--- a/src/components/editors/scss/item-editor.scss
+++ b/src/components/editors/scss/item-editor.scss
@@ -27,4 +27,14 @@
input[type=number] {
-moz-appearance: textfield;
}
+
+ .checkbox-label {
+ border: none;
+ max-width: none;
+ justify-content: left;
+ input {
+ display: inline;
+ width: 1.4rem;
+ }
+ }
}