diff options
author | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-04-30 08:39:53 +0530 |
---|---|---|
committer | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-04-30 08:39:53 +0530 |
commit | a5528f2092098a224a6e78199c80e4cb6a21995f (patch) | |
tree | 9e20a147e1700a1fd90a9f448db3bd9562d10d69 /src/components/BillingPage.js | |
parent | 5f9cdac0d2f0522cacc092b1fcde523cddf3d97f (diff) |
updating the items list on runtime + fixed at least 3 bugs emerged due to that
Diffstat (limited to 'src/components/BillingPage.js')
-rw-r--r-- | src/components/BillingPage.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js index c2aa158..0542d2e 100644 --- a/src/components/BillingPage.js +++ b/src/components/BillingPage.js @@ -13,10 +13,9 @@ import AddNewItemForm from "./Form/AddNewItemForm"; import RegisterItemForm from "./Form/RegisterItemForm"; import MetaInfoForm from "./Form/MetaInfoForm"; import ItemsDisplay from "./Display/ItemsDisplay"; -import SummaryDisplay from "./Display/SummaryDisplay"; - -const BillingPage = () => { +import SummaryDisplay from "./Display/SummaryDisplay"; const BillingPage = () => { const [savedItems, getSavedItems] = useState([]); + const [registerFormVisibility, setRegisterFormVisibility] = useState(false); const getRegisteredItems = () => { axios.get(`/api/items`) @@ -46,8 +45,18 @@ const BillingPage = () => { return ( <> - <AddNewItemForm savedItems={savedItems} addItem={getItems} defGSTValue={defGSTValue}/> - <RegisterItemForm updateItemsList={getRegisteredItems}/> + <AddNewItemForm savedItems={savedItems} + addItem={getItems} + defGSTValue={defGSTValue} + registerFormVisibility={setRegisterFormVisibility} + /> + + { registerFormVisibility && + <RegisterItemForm + updateItemsList={getRegisteredItems} + setVisibility={setRegisterFormVisibility}/> + } + <ItemsDisplay items={items} defGSTValue={defGSTValue}/> <div className={"BillingPageFlex"}> <MetaInfoForm/> |