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 --- src/components/Form/AddNewItemForm.js | 4 +- src/components/Form/Form.css | 31 +++++--- src/components/Form/Form.scss | 10 +++ src/components/Form/RegisterItemForm.js | 124 +++++++++++++++++++------------- 4 files changed, 106 insertions(+), 63 deletions(-) (limited to 'src/components/Form') 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