aboutsummaryrefslogtreecommitdiff
path: root/src/components/BillingPage.js
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-16 18:40:50 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-16 18:40:50 +0530
commit034a41ad44144e79c1c58a3b4f8741ddf8d56f8c (patch)
treef53449f61045508c6f2de218623cd43237e48e78 /src/components/BillingPage.js
parent03a991b1c59e010253f8673a4aa82c89f7bc7d13 (diff)
implemented a way for AddNewItemForm and BillingPage to talk to each other and share data
Diffstat (limited to 'src/components/BillingPage.js')
-rw-r--r--src/components/BillingPage.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js
index f4b2b11..ca51651 100644
--- a/src/components/BillingPage.js
+++ b/src/components/BillingPage.js
@@ -21,13 +21,18 @@ const sampleData = [
}
];
+// called when AddNewItemForm is submitted
+let addedItems = [];
+const getAddedItems = (item) => {
+ addedItems.push(item);
+}
+
+const defGSTValue = 18;
+
const BillingPage = () => {
return (
<>
- <AddNewItemForm savedItems={sampleData} />
- <AddNewItemForm savedItems={sampleData} />
- <AddNewItemForm savedItems={sampleData} />
- <AddNewItemForm savedItems={sampleData} />
+ <AddNewItemForm savedItems={sampleData} addItem={getAddedItems} defGSTValue={defGSTValue}/>
</>
);
}