aboutsummaryrefslogtreecommitdiff
path: root/src/components/BillingPage.js
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-16 23:09:12 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-16 23:09:12 +0530
commitf1475f5815d2accd40342c95ed2cf97a96e6d676 (patch)
tree5ff6f63d313482a13b6d22f47cfe59b1d57fdd04 /src/components/BillingPage.js
parentf227adee3cff445288bdba66d369a451aa31b58e (diff)
Now the data is being pass correctly from AddNewItemForm to ItemDisplay but I need to work on processing the data
Diffstat (limited to 'src/components/BillingPage.js')
-rw-r--r--src/components/BillingPage.js21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js
index b06e876..1ff8654 100644
--- a/src/components/BillingPage.js
+++ b/src/components/BillingPage.js
@@ -23,21 +23,34 @@ const sampleData = [
const BillingPage = () => {
- const [items, setItems] = useState([]);
+ // to be handled by backend
const defGSTValue = 18;
+ /* Note to the dumbass coding this alone
+ * Right now only the models are getting passed
+ * into ItemsDisplay because I wanted to
+ * take screenshots and shit.
+ * Implement a feature such that I can pass in a
+ * whole array of objects and ItemsDisplay processes
+ * the itemNames, prices and shit.
+ * This file should only handle
+ * getting the items from AddNewItemForm
+ * putting it into the list
+ * and pass it into ItemsDisplay
+ */
+ const [items, setItems] = useState([]);
const getItems = (item) => {
setItems(
- [...items, item]
+ [...items, item.Model]
);
- }
+ };
console.log(items)
return (
<div>
<AddNewItemForm savedItems={sampleData} addItem={getItems} defGSTValue={defGSTValue}/>
- <ItemsDisplay/>
+ <ItemsDisplay items={items}/>
</div>
);
}