diff options
author | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-05-02 14:58:33 +0530 |
---|---|---|
committer | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-05-02 14:58:33 +0530 |
commit | 54fd6380d550b75137dad64502c21226aadd1550 (patch) | |
tree | 9247e786aa08734a9ce24df11614559344549c50 /src/components/Form/AddNewItemForm.js | |
parent | 18dc01ae096b292ac40d41792459aec623f4f830 (diff) |
cleaned up the code and redesigned RegisterItemForm and added more functionality
Diffstat (limited to 'src/components/Form/AddNewItemForm.js')
-rw-r--r-- | src/components/Form/AddNewItemForm.js | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/src/components/Form/AddNewItemForm.js b/src/components/Form/AddNewItemForm.js index 81cbd3f..69a53f3 100644 --- a/src/components/Form/AddNewItemForm.js +++ b/src/components/Form/AddNewItemForm.js @@ -104,11 +104,7 @@ const AddNewItemForm = (props) => { <label> Description: - <input - className={"wideInputBox"} - type="text" - step="0.1" - value={itemDescValue} + <input className={"wideInputBox"} type="text" step="0.1" value={itemDescValue} onChange={ (event) => { setItemDescValue(event.target.value); @@ -121,11 +117,7 @@ const AddNewItemForm = (props) => { <div className={"widePane"}> <label> Quantity: - <input - className={"smallInputBox"} - type="number" - min="1" - value={itemQtyValue} + <input className={"smallInputBox"} type="number" min="1" value={itemQtyValue} onInput={ (event) => { const value = event.target.value; @@ -137,12 +129,7 @@ const AddNewItemForm = (props) => { <label> Price: - <input - className={"smallInputBox"} - type="number" - min="1.00" - step="0.001" - value={itemPriceValue} + <input className={"smallInputBox"} type="number" min="1.00" step="0.001" value={itemPriceValue} onChange={ (event) => { const value = event.target.value; @@ -154,12 +141,7 @@ const AddNewItemForm = (props) => { <label> Discount: - <input - className={"smallInputBox"} - type="number" - min="0" - step="0.001" - value={itemDiscountValue} + <input className={"smallInputBox"} type="number" min="0" step="0.001" value={itemDiscountValue} onChange={ (event) => { const value = event.target.value; @@ -171,11 +153,7 @@ const AddNewItemForm = (props) => { <label> HSN: - <input - className={"smallInputBox"} - type="number" - min="0" - value={itemHSNValue} + <input className={"smallInputBox"} type="number" min="0" value={itemHSNValue} onChange={ (event) => { const value = event.target.value; @@ -187,11 +165,7 @@ const AddNewItemForm = (props) => { <label> GST: - <input - className={"smallInputBox"} - type="number" - min="0" - value={itemGSTValue} + <input className={"smallInputBox"} type="number" min="0" value={itemGSTValue} onChange={ (event) => { const value = event.target.value; @@ -212,9 +186,7 @@ const AddNewItemForm = (props) => { <input type="button" value="Placeholder2" /> <input type="submit" value="Force Add" /> - <input - type="submit" - value="add" + <input type="submit" value="add" disabled={ (emptyItemNames.includes(itemNameValue) || itemQtyValue <= 0 |