From 05dcdcc398af3ec859a750d7e514a286a265da94 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Wed, 28 Apr 2021 17:53:25 +0530 Subject: styled the RegisterItemForm properly and introduced like 20 bugs --- server/openbills.db | Bin 12288 -> 12288 bytes src/components/BillingPage.js | 4 +- src/components/Form/AddNewItemForm.js | 4 +- src/components/Form/Form.css | 31 +++++--- src/components/Form/Form.scss | 10 +++ src/components/Form/RegisterItemForm.js | 124 +++++++++++++++++++------------- 6 files changed, 108 insertions(+), 65 deletions(-) diff --git a/server/openbills.db b/server/openbills.db index 4f15f57..a5372f2 100644 Binary files a/server/openbills.db and b/server/openbills.db differ diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js index fc09694..c2aa158 100644 --- a/src/components/BillingPage.js +++ b/src/components/BillingPage.js @@ -16,7 +16,7 @@ import ItemsDisplay from "./Display/ItemsDisplay"; import SummaryDisplay from "./Display/SummaryDisplay"; const BillingPage = () => { - const [savedItems, getSavedItems] = useState([]) + const [savedItems, getSavedItems] = useState([]); const getRegisteredItems = () => { axios.get(`/api/items`) @@ -47,7 +47,7 @@ const BillingPage = () => { return ( <> - +
diff --git a/src/components/Form/AddNewItemForm.js b/src/components/Form/AddNewItemForm.js index 5028af2..877e9f4 100644 --- a/src/components/Form/AddNewItemForm.js +++ b/src/components/Form/AddNewItemForm.js @@ -157,11 +157,13 @@ const AddNewItemForm = (props) => {
{ - alert("Coming Soon") + alert("this shit refuses to work") }} /> + + { +const RegisterItemForm = (props) => { // show/hide this component - const [visibility, setVisibility] = useState(true)// useState(props.visibility); + // experimental + const [visibility, setVisibility] = useState(true); const [newItemNameValue, setNewItemNameValue] = useState(""); const [newItemDescValue, setNewItemDescValue] = useState(""); @@ -29,9 +32,13 @@ const RegisterItemForm = () => { return (
-
{ event.preventDefault(); + + // experimental + // make sure it shows confirmation + // before hiding itself setVisibility(false); axios.post(`/api/items/?model=${newItemNameValue}&desc=${newItemDescValue}&price=${newItemPriceValue}&hsn=${newItemHSNValue}&gst=${newItemGSTValue}`) @@ -41,60 +48,75 @@ const RegisterItemForm = () => { .catch((err) => { console.log(err); }); + props.updateItemsList(); } }> -
- +
+
+ - + +
+ +
+ + + + + +
-
- - - - -
); -- cgit v1.2.3