@@ -22,6 +22,11 @@ const AddRestaurantPage = () => {
22
22
const [ name , setName ] = useState < string | null > ( null ) ;
23
23
const [ description , setDescription ] = useState < string | null > ( null ) ;
24
24
const [ address , setAddress ] = useState < string | null > ( null ) ;
25
+ const [ localArea , setLocalArea ] = useState < string > ( "" ) ;
26
+ const [ city , setCity ] = useState < string > ( "" ) ;
27
+ const [ state , setState ] = useState < string > ( "" ) ;
28
+ const [ postalCode , setPostalCode ] = useState < number > ( 0 ) ;
29
+ const [ country , setCountry ] = useState < string > ( "India" ) ;
25
30
const [ phone , setPhone ] = useState < string > ( "" ) ;
26
31
const [ tags , setTags ] = useState < string [ ] > ( [ ] ) ;
27
32
const [ isPublic , setIsPublic ] = useState < boolean > ( true ) ;
@@ -44,6 +49,11 @@ const AddRestaurantPage = () => {
44
49
name : z . string ( ) . min ( 3 ) ,
45
50
description : z . string ( ) . min ( 5 ) ,
46
51
address : z . string ( ) . min ( 10 ) ,
52
+ local_area : z . string ( ) . min ( 3 ) ,
53
+ city : z . string ( ) . min ( 3 ) ,
54
+ state : z . string ( ) . min ( 3 ) ,
55
+ postal_code : z . number ( ) . positive ( ) . min ( 5 ) ,
56
+ country : z . string ( ) . min ( 3 ) ,
47
57
images : z
48
58
. array ( z . string ( ) . min ( 10 ) )
49
59
. min ( 1 , { message : "Images is required" } ) ,
@@ -75,6 +85,11 @@ const AddRestaurantPage = () => {
75
85
name : name ,
76
86
description : description ,
77
87
address : address ,
88
+ local_area : localArea ,
89
+ city : city ,
90
+ state : state ,
91
+ postal_code : postalCode ,
92
+ country : country ,
78
93
images : images ,
79
94
phone : parseInt ( phone ) ,
80
95
tags : tags ,
@@ -98,6 +113,11 @@ const AddRestaurantPage = () => {
98
113
name : name ,
99
114
description : description ,
100
115
address : address ,
116
+ local_area : localArea ,
117
+ city : city ,
118
+ state : state ,
119
+ postal_code : postalCode ,
120
+ country : country ,
101
121
images : images ,
102
122
phone : parseInt ( phone ) ,
103
123
tags : tags . map ( ( tag ) => tag . toLowerCase ( ) ) ,
@@ -213,6 +233,99 @@ const AddRestaurantPage = () => {
213
233
{ errors . find ( ( error ) => error . for === "address" ) ?. message }
214
234
</ div >
215
235
</ div >
236
+ < div className = "flex flex-col gap-5.5 sm:flex-row" >
237
+ < div className = "w-full sm:w-1/2" >
238
+ < label className = "mb-3 block text-sm font-medium text-black dark:text-white" >
239
+ Local Area < span className = "text-meta-1" > *</ span >
240
+ </ label >
241
+ < div className = "relative" >
242
+ < input
243
+ className = "w-full rounded border border-stroke px-5 py-3 text-black focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary"
244
+ type = "text"
245
+ placeholder = "Katargam"
246
+ required
247
+ autoComplete = "off"
248
+ onChange = { ( e ) => setLocalArea ( e . target . value ) }
249
+ />
250
+ </ div >
251
+ < div className = "mt-1 text-xs text-meta-1" >
252
+ { errors . find ( ( error ) => error . for === "localArea" ) ?. message }
253
+ </ div >
254
+ </ div >
255
+
256
+ < div className = "w-full sm:w-1/2" >
257
+ < label className = "mb-3 block text-sm font-medium text-black dark:text-white" >
258
+ City < span className = "text-meta-1" > *</ span >
259
+ </ label >
260
+ < input
261
+ className = "w-full rounded border border-stroke px-5 py-3 text-black focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary"
262
+ type = "text"
263
+ placeholder = "Surat"
264
+ required
265
+ autoComplete = "off"
266
+ onChange = { ( e ) => setCity ( e . target . value as any ) }
267
+ />
268
+ < div className = "mt-1 text-xs text-meta-1" >
269
+ { errors . find ( ( error ) => error . for === "city" ) ?. message }
270
+ </ div >
271
+ </ div >
272
+ </ div >
273
+ < div className = "flex flex-col gap-5.5 sm:flex-row" >
274
+ < div className = "w-full sm:w-1/2" >
275
+ < label className = "mb-3 block text-sm font-medium text-black dark:text-white" >
276
+ State < span className = "text-meta-1" > *</ span >
277
+ </ label >
278
+ < div className = "relative" >
279
+ < input
280
+ className = "w-full rounded border border-stroke px-5 py-3 text-black focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary"
281
+ type = "text"
282
+ placeholder = "Gujarat"
283
+ required
284
+ autoComplete = "off"
285
+ onChange = { ( e ) => setState ( e . target . value ) }
286
+ />
287
+ </ div >
288
+ < div className = "mt-1 text-xs text-meta-1" >
289
+ { errors . find ( ( error ) => error . for === "state" ) ?. message }
290
+ </ div >
291
+ </ div >
292
+
293
+ < div className = "w-full sm:w-1/2" >
294
+ < label className = "mb-3 block text-sm font-medium text-black dark:text-white" >
295
+ Postal Code < span className = "text-meta-1" > *</ span >
296
+ </ label >
297
+ < input
298
+ className = "w-full rounded border border-stroke px-5 py-3 text-black focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary"
299
+ type = "number"
300
+ placeholder = "395004"
301
+ required
302
+ autoComplete = "off"
303
+ onChange = { ( e ) => setPostalCode ( parseInt ( e . target . value ) ) }
304
+ />
305
+ < div className = "mt-1 text-xs text-meta-1" >
306
+ { errors . find ( ( error ) => error . for === "postalCode" ) ?. message }
307
+ </ div >
308
+ </ div >
309
+ </ div >
310
+ < div >
311
+ < label className = "mb-3 block text-sm font-medium text-black dark:text-white" >
312
+ Country < span className = "text-meta-1" > *</ span >
313
+ </ label >
314
+ < div className = "relative" >
315
+ < input
316
+ className = "w-full rounded border border-stroke px-5 py-3 text-black focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary"
317
+ type = "text"
318
+ placeholder = "India"
319
+ defaultValue = "India"
320
+ required
321
+ autoComplete = "off"
322
+ onChange = { ( e ) => setCountry ( e . target . value ) }
323
+ />
324
+ </ div >
325
+ < div className = "mt-1 text-xs text-meta-1" >
326
+ { errors . find ( ( error ) => error . for === "country" ) ?. message }
327
+ </ div >
328
+ </ div >
216
329
< div >
217
330
< label className = "mb-3 block text-sm font-medium text-black dark:text-white" >
218
331
Tags < span className = "text-meta-1" > *</ span >
0 commit comments