aboutsummaryrefslogtreecommitdiff
path: root/src/components/Form
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-14 20:29:54 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-14 20:29:54 +0530
commitee824f566add80998e2530f7bec54ff4d7a1471d (patch)
tree4b7d1da5908baf8e5e0ef6b67ecdca3f09296a86 /src/components/Form
parent4c92b12bcb886507d5db738a27bd08e7654f8bfa (diff)
Played around with forms
Diffstat (limited to 'src/components/Form')
-rw-r--r--src/components/Form/Form.css4
-rw-r--r--src/components/Form/Form.js56
-rw-r--r--src/components/Form/Form.scss5
3 files changed, 65 insertions, 0 deletions
diff --git a/src/components/Form/Form.css b/src/components/Form/Form.css
new file mode 100644
index 0000000..d0ecc5f
--- /dev/null
+++ b/src/components/Form/Form.css
@@ -0,0 +1,4 @@
+form {
+ border: 1px solid purple;
+ display: flex;
+ justify-content: space-evenly; }
diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js
new file mode 100644
index 0000000..1261e4b
--- /dev/null
+++ b/src/components/Form/Form.js
@@ -0,0 +1,56 @@
+import React, { useState } from "react";
+import "./Form.css";
+
+const BillingForm = () => {
+ /*
+ const sampleData = [
+ {
+ "Model": "Kisan Chair",
+ "Description":"Very good chair",
+ "Price":"10000",
+ "Discount":"3%"
+ },
+ {
+ "Model": "Supreme Chair",
+ "Description":"Even better chair",
+ "Price":"2134983",
+ "Discount":"9%"
+ }
+ ]
+ */
+ const [itemValue, setItemValue] = useState("");
+ const [descValue, setDescValue] = useState("");
+
+
+
+ return (
+ <form onSubmit={
+ (event) => {
+ event.preventDefault();
+ console.log(itemValue, descValue);
+ }
+ }>
+
+ <label>
+ Item: <input type="text" value={itemValue} onChange={
+ (event) => {
+ setItemValue(event.target.value);
+ }
+ } />
+ </label>
+
+ <label>
+ Description: <input type="text" value={descValue} onChange={
+ (event) => {
+ setDescValue(event.target.value);
+ }
+ } />
+ </label>
+
+ <input type="submit" value="add" />
+
+ </form>
+ )
+}
+
+export default BillingForm;
diff --git a/src/components/Form/Form.scss b/src/components/Form/Form.scss
new file mode 100644
index 0000000..01f9bf2
--- /dev/null
+++ b/src/components/Form/Form.scss
@@ -0,0 +1,5 @@
+form {
+ border: 1px solid purple;
+ display: flex;
+ justify-content: space-evenly;
+}