From 54fd6380d550b75137dad64502c21226aadd1550 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sun, 2 May 2021 14:58:33 +0530 Subject: cleaned up the code and redesigned RegisterItemForm and added more functionality --- src/components/Form/RegisterItemForm.js | 104 ++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 38 deletions(-) (limited to 'src/components/Form/RegisterItemForm.js') diff --git a/src/components/Form/RegisterItemForm.js b/src/components/Form/RegisterItemForm.js index fca0916..30d23b6 100644 --- a/src/components/Form/RegisterItemForm.js +++ b/src/components/Form/RegisterItemForm.js @@ -11,30 +11,82 @@ // TODO: Implement override protection -import React/*, { useState }*/ from "react"; +import React, { useState } from "react"; // import axios from "axios"; import "./Form.scss"; -const RegisterItemForm = (/*props*/) => { -// const [newItemNameValue, setNewItemNameValue] = useState(""); -// const [newItemDescValue, setNewItemDescValue] = useState(""); -// const [newItemPriceValue, setNewItemPriceValue] = useState(0.00); -// const [newItemHSNValue, setNewItemHSNValue] = useState(""); -// const [newItemGSTValue, setNewItemGSTValue] = useState(props.defGSTValue); +const RegisterItemForm = (props) => { + const [newItemNameValue, setNewItemNameValue] = useState(""); + const [newItemDescValue, setNewItemDescValue] = useState(""); + const [newItemPriceValue, setNewItemPriceValue] = useState(0.00); + const [newItemHSNValue, setNewItemHSNValue] = useState(""); + const [newItemGSTValue, setNewItemGSTValue] = useState(props.defGSTValue); // const [newItemBrandValue, setNewItemBrandValue] = useState(""); // const [newItemTypeValue, setNewItemTypeValue] = useState(""); + const hideSelf = () => props.setVisibility(false); + + const closeOnBGClicked = (event) => + event.target.className === "floatingMenuBG" && hideSelf(); return ( -
-
+
+
-
-
-
- -
+ +
+ +
+ + + + + +
+ +
+ + + + + + + +
@@ -88,32 +140,8 @@ const RegisterItemForm = (/*props*/) => {
- - -
-- cgit v1.2.3