aboutsummaryrefslogtreecommitdiff
path: root/src/components/Form/Address/NewAddressPane.tsx
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-09-13 17:25:51 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-09-13 17:25:51 +0530
commit92b6da1d37da9232f1f40ac2526b189289049534 (patch)
treefc24820364207b659a64f2a7f539a62a2541f9df /src/components/Form/Address/NewAddressPane.tsx
parentb2642dee763627b6889aadc4bbfcd201abbdd498 (diff)
created new new address component for unlimited addresses
Diffstat (limited to 'src/components/Form/Address/NewAddressPane.tsx')
-rw-r--r--src/components/Form/Address/NewAddressPane.tsx69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/components/Form/Address/NewAddressPane.tsx b/src/components/Form/Address/NewAddressPane.tsx
new file mode 100644
index 0000000..4dd3788
--- /dev/null
+++ b/src/components/Form/Address/NewAddressPane.tsx
@@ -0,0 +1,69 @@
+/*
+ * OpenBills - Self hosted browser app to generate and keep track of simple invoices
+ * Version - 0
+ * Licensed under the MIT license - https://opensource.org/licenses/MIT
+ *
+ * Copyright (c) 2021 Vidhu Kant Sharma
+*/
+
+import React, { Dispatch, SetStateAction, useState } from "react";
+import "./../Form.scss";
+import { Address } from "./../../../Interfaces/interfaces"
+
+interface Props {
+ heading: string
+ address: Address
+ setAddress: Dispatch<SetStateAction<Address>>
+}
+
+const NewAddressPane: React.FC<Props> = (props) => {
+ const address = props.address;
+
+return (
+ <div className={"widePane formPane"}>
+ <h3>{props.heading}</h3>
+
+ <label>
+ Address: <input className={"wideInputBox"}
+ type="text" value={address.AddressLine} onChange={
+ ({target: {value}}) => props.setAddress({...address, AddressLine: value})
+ }
+ required />
+ </label>
+
+ <label>
+ City: <input className={"wideInputBox"}
+ type="text" value={address.City} onChange={
+ ({target: {value}}) => props.setAddress({...address, City: value})
+ }
+ required />
+ </label>
+
+ <label>
+ State: <input className={"wideInputBox"}
+ type="text" value={address.State} onChange={
+ ({target: {value}}) => props.setAddress({...address, State: value})
+ }
+ required />
+ </label>
+
+ <label>
+ PIN Code: <input className={"wideInputBox"}
+ type="text" value={address.PINCode} onChange={
+ ({target: {value}}) => props.setAddress({...address, PINCode: value})
+ }
+ required />
+ </label>
+
+ <label>
+ Country: <input className={"wideInputBox"}
+ type="text" value={address.Country} onChange={
+ ({target: {value}}) => props.setAddress({...address, Country: value})
+ }
+ required />
+ </label>
+ </div>
+ );
+}
+
+export default NewAddressPane;