BusinessDetails.js
20.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
import { Formik } from "formik";
import { Fragment } from "react";
import { Button, Form } from "react-bootstrap";
import * as Yup from "yup";
const BusinessDetails = () => {
const businessDetailsValidationSchema = Yup.object().shape({
pan_number: Yup.string()
.required("Pan Number is Required"),
pan_file: Yup.string()
.required("Pan Image is Required"),
gst_number: Yup.string()
.required("GST Number is Required"),
gst_certificate_file: Yup.string()
.required("GST Certificate is Required"),
business_name: Yup.string()
.required("Business Name is Required"),
brand_logo_file: Yup.string()
.required("Brand Logo is Required"),
pincode: Yup.string()
.required("Pincode is Required"),
country: Yup.string()
.required("Country is Required"),
state: Yup.string()
.required("State is Required"),
city: Yup.string()
.required("City is Required"),
address_line1: Yup.string()
.required("Address Line 1 is Required"),
address_line2: Yup.string()
.required("Address Line 2 is Required"),
});
return (
<Fragment>
<div className="container p-5">
<div className="row">
<div className="col-12 col-lg-8">
<div className="content-div business-details">
<h2>Tell us about your business</h2>
<p>Please have the following ready before you begin</p>
<p><i className="fa fa-arrow-right me-1"></i> Your bank account details for receiving payments from ZanGO</p>
<p><i className="fa fa-arrow-right me-1"></i> Tax (GST/PAN) details of your business.</p>
<hr />
<div className="form-container">
<Formik
initialValues={{
pan_number: "",
pan_file: "",
gst_number: "",
gst_certificate_file: "",
business_name: "",
brand_logo_file: "",
pincode: "",
country: "",
state: "",
city: "",
address_line1: "",
address_line2: ""
}}
validationSchema={businessDetailsValidationSchema}
// enableReinitialize={true}
onSubmit={values => {
console.log("business details values", values)
}}
>
{({ values, errors, touched, handleChange, handleBlur, handleSubmit }) => (
<Form
onSubmit={e => {
e.preventDefault();
handleSubmit();
}}
>
<h4>Vendor Business Information</h4>
<div>
<p>Business documents</p>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Enter Business PAN No.</label>
<input
type="text"
name="pan_number"
onChange={handleChange}
onBlur={handleBlur}
value={values.pan_number}
/>
{errors.pan_number && touched.pan_number && (<span className="form-error">{errors.pan_number}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Upload PAN</label>
<input
type="file"
name="pan_file"
onChange={handleChange}
onBlur={handleBlur}
value={values.pan_file}
/>
{errors.pan_file && touched.pan_file && (<span className="form-error">{errors.pan_file}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>GST Number</label>
<input
type="text"
name="gst_number"
onChange={handleChange}
onBlur={handleBlur}
value={values.gst_number}
/>
{errors.gst_number && touched.gst_number && (<span className="form-error">{errors.gst_number}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>GST Certificate</label>
<input
type="file"
name="gst_certificate_file"
onChange={handleChange}
onBlur={handleBlur}
value={values.gst_certificate_file}
/>
{errors.gst_certificate_file && touched.gst_certificate_file && (<span className="form-error">{errors.gst_certificate_file}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Business Name</label>
<input
type="text"
name="business_name"
onChange={handleChange}
onBlur={handleBlur}
value={values.business_name}
/>
{errors.business_name && touched.business_name && (<span className="form-error">{errors.business_name}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Brand Logo</label>
<input
type="file"
name="brand_logo_file"
onChange={handleChange}
onBlur={handleBlur}
value={values.brand_logo_file}
/>
{errors.brand_logo_file && touched.brand_logo_file && (<span className="form-error">{errors.brand_logo_file}</span>)}
</div>
</div>
</div>
</div>
<hr />
<div>
<p>Business Address</p>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Pincode</label>
<input
type="text"
name="pincode"
onChange={handleChange}
onBlur={handleBlur}
value={values.pincode}
/>
{errors.pincode && touched.pincode && (<span className="form-error">{errors.pincode}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Country</label>
<select
id="country"
name="country"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="India">India</option>
<option value="America">America</option>
</select>
{errors.country && touched.country && (<span className="form-error">{errors.country}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>State</label>
<select
id="state"
name="state"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="India">India</option>
<option value="America">America</option>
</select>
{errors.state && touched.state && (<span className="form-error">{errors.state}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>City</label>
<select
id="city"
name="city"
onChange={handleChange}
onBlur={handleBlur}
>
<option value="India">India</option>
<option value="America">America</option>
</select>
{errors.city && touched.city && (<span className="form-error">{errors.city}</span>)}
</div>
</div>
</div>
<div className="row">
<div className="col-12 col-lg-5">
<div className="input-group">
<label>Address Line 1</label>
<input
type="text"
name="address_line1"
onChange={handleChange}
onBlur={handleBlur}
value={values.address_line1}
/>
{errors.address_line1 && touched.address_line1 && (<span className="form-error">{errors.address_line1}</span>)}
</div>
</div>
<div className="col-12 offset-lg-1 col-lg-5">
<div className="input-group">
<label>Address Line 2</label>
<input
type="text"
name="address_line2"
onChange={handleChange}
onBlur={handleBlur}
value={values.address_line2}
/>
{errors.address_line2 && touched.address_line2 && (<span className="form-error">{errors.address_line2}</span>)}
</div>
</div>
</div>
</div>
<div className="row mb-5">
<div className="col-12 col-lg-5">
<div className="input-group">
<Button type="submit" className="btn btn-primary btn-submit">
Send for Approval
</Button>
</div>
</div>
</div>
</Form>
)}
</Formik>
</div>
</div>
</div>
<div className="col-12 col-lg-4">
<div className="content-div help-center">
<h2>Help Center</h2>
<ul className="helplist">
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/question.svg" className="img-fluid" />
<p>Lorem Ipsum Dolor Sit?</p>
</li>
<li>
<img src="/images/vendor/call.svg" className="img-fluid" />
<p>+1 (407) 8798 789</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</Fragment >
)
}
export default BusinessDetails;