ordering-ui-react-native 0.22.24 → 0.22.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.22.24",
3
+ "version": "0.22.26",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -25,8 +25,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
25
25
  value: language?.code,
26
26
  label: language?.name,
27
27
  inputLabel: language?.code.toUpperCase(),
28
- countryCode: langCountries.find(item => item.value == language?.code)
29
- ?.countryCode,
28
+ countryCode: langCountries.find(item => item.value == language?.code)?.countryCode,
30
29
  };
31
30
  });
32
31
 
@@ -50,6 +49,9 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
50
49
  },
51
50
  });
52
51
 
52
+ console.log('_languages', _languages);
53
+
54
+
53
55
  return (
54
56
  <Container style={{ backgroundColor: theme.colors.inputChat }}>
55
57
  {languagesState?.languages && (
@@ -5,18 +5,6 @@
5
5
  "value": "en",
6
6
  "countryCode": "US"
7
7
  },
8
- {
9
- "inputLabel": "DE",
10
- "label": "German",
11
- "value": "de",
12
- "countryCode": "DE"
13
- },
14
- {
15
- "inputLabel": "ES",
16
- "label": "Spanish",
17
- "value": "es",
18
- "countryCode": "ES"
19
- },
20
8
  {
21
9
  "inputLabel": "MX",
22
10
  "label": "Spanish",
@@ -30,22 +18,70 @@
30
18
  "countryCode": "GT"
31
19
  },
32
20
  {
33
- "inputLabel": "DA",
34
- "label": "Danish",
35
- "value": "da",
36
- "countryCode": "DK"
21
+ "inputLabel": "AF",
22
+ "label": "Afghanistan",
23
+ "value": "af",
24
+ "countryCode": "AF"
37
25
  },
38
26
  {
39
- "inputLabel": "NL",
40
- "label": "Dutch",
41
- "value": "nl",
42
- "countryCode": "NL"
27
+ "inputLabel": "AL",
28
+ "label": "Albania",
29
+ "value": "sq",
30
+ "countryCode": "AL"
43
31
  },
44
32
  {
45
- "inputLabel": "PT",
46
- "label": "Portuguese",
47
- "value": "pt",
48
- "countryCode": "PT"
33
+ "inputLabel": "AD",
34
+ "label": "Andorra",
35
+ "value": "ca",
36
+ "countryCode": "AD"
37
+ },
38
+ {
39
+ "inputLabel": "AM",
40
+ "label": "Armenia",
41
+ "value": "hy",
42
+ "countryCode": "AM"
43
+ },
44
+ {
45
+ "inputLabel": "AZ",
46
+ "label": "Azerbaijan",
47
+ "value": "az",
48
+ "countryCode": "AZ"
49
+ },
50
+ {
51
+ "inputLabel": "BD",
52
+ "label": "Bangladesh",
53
+ "value": "bn",
54
+ "countryCode": "BD"
55
+ },
56
+ {
57
+ "inputLabel": "BY",
58
+ "label": "Belarus",
59
+ "value": "be",
60
+ "countryCode": "BY"
61
+ },
62
+ {
63
+ "inputLabel": "BT",
64
+ "label": "Bhutan",
65
+ "value": "dz",
66
+ "countryCode": "BT"
67
+ },
68
+ {
69
+ "inputLabel": "BA",
70
+ "label": "Bosnia and Herzegovina",
71
+ "value": "bs",
72
+ "countryCode": "BA"
73
+ },
74
+ {
75
+ "inputLabel": "BG",
76
+ "label": "Bulgaria",
77
+ "value": "bg",
78
+ "countryCode": "BG"
79
+ },
80
+ {
81
+ "inputLabel": "BI",
82
+ "label": "Burundi",
83
+ "value": "rn",
84
+ "countryCode": "BI"
49
85
  },
50
86
  {
51
87
  "inputLabel": "CA",
@@ -53,42 +89,174 @@
53
89
  "value": "ca",
54
90
  "countryCode": "ES"
55
91
  },
92
+ {
93
+ "inputLabel": "KH",
94
+ "label": "Cambodia",
95
+ "value": "km",
96
+ "countryCode": "KH"
97
+ },
98
+ {
99
+ "inputLabel": "CN",
100
+ "label": "China",
101
+ "value": "zh",
102
+ "countryCode": "CN"
103
+ },
104
+ {
105
+ "inputLabel": "HR",
106
+ "label": "Croatia",
107
+ "value": "hr",
108
+ "countryCode": "HR"
109
+ },
110
+ {
111
+ "inputLabel": "CZ",
112
+ "label": "Czechia",
113
+ "value": "cs",
114
+ "countryCode": "CZ"
115
+ },
116
+ {
117
+ "inputLabel": "DK",
118
+ "label": "Denmark",
119
+ "value": "da",
120
+ "countryCode": "DK"
121
+ },
122
+ {
123
+ "inputLabel": "DJ",
124
+ "label": "Djibouti",
125
+ "value": "aa",
126
+ "countryCode": "DJ"
127
+ },
128
+ {
129
+ "inputLabel": "EE",
130
+ "label": "Estonia",
131
+ "value": "et",
132
+ "countryCode": "EE"
133
+ },
134
+ {
135
+ "inputLabel": "SZ",
136
+ "label": "Eswatini",
137
+ "value": "ss",
138
+ "countryCode": "SZ"
139
+ },
140
+ {
141
+ "inputLabel": "ET",
142
+ "label": "Ethiopia",
143
+ "value": "am",
144
+ "countryCode": "ET"
145
+ },
146
+ {
147
+ "inputLabel": "FO",
148
+ "label": "Faroe Islands",
149
+ "value": "fo",
150
+ "countryCode": "FO"
151
+ },
152
+ {
153
+ "inputLabel": "FJ",
154
+ "label": "Fiji",
155
+ "value": "fj",
156
+ "countryCode": "FJ"
157
+ },
158
+ {
159
+ "inputLabel": "FI",
160
+ "label": "Finland",
161
+ "value": "fi",
162
+ "countryCode": "FI"
163
+ },
56
164
  {
57
165
  "inputLabel": "FR",
58
- "label": "French",
166
+ "label": "France",
59
167
  "value": "fr",
60
168
  "countryCode": "FR"
61
169
  },
62
170
  {
63
- "inputLabel": "TR",
64
- "label": "Turkish",
65
- "value": "tr",
66
- "countryCode": "TR"
171
+ "inputLabel": "GE",
172
+ "label": "Georgia",
173
+ "value": "ka",
174
+ "countryCode": "GE"
67
175
  },
68
176
  {
69
- "inputLabel": "KM",
70
- "label": "Cambodian",
71
- "value": "km",
72
- "countryCode": "KH"
177
+ "inputLabel": "DE",
178
+ "label": "Germany",
179
+ "value": "de",
180
+ "countryCode": "DE"
73
181
  },
74
182
  {
75
- "inputLabel": "ZH-CN",
76
- "label": "Chinese Simplified",
77
- "value": "zh-CN",
78
- "countryCode": "CN"
183
+ "inputLabel": "GH",
184
+ "label": "Ghana",
185
+ "value": "ak",
186
+ "countryCode": "GH"
187
+ },
188
+ {
189
+ "inputLabel": "GR",
190
+ "label": "Greece",
191
+ "value": "el",
192
+ "countryCode": "GR"
193
+ },
194
+ {
195
+ "inputLabel": "GL",
196
+ "label": "Greenland",
197
+ "value": "kl",
198
+ "countryCode": "GL"
199
+ },
200
+ {
201
+ "inputLabel": "HT",
202
+ "label": "Haiti",
203
+ "value": "ht",
204
+ "countryCode": "HT"
79
205
  },
80
206
  {
81
- "inputLabel": "HI",
82
- "label": "Hindi",
207
+ "inputLabel": "HU",
208
+ "label": "Hungary",
209
+ "value": "hu",
210
+ "countryCode": "HU"
211
+ },
212
+ {
213
+ "inputLabel": "IS",
214
+ "label": "Iceland",
215
+ "value": "is",
216
+ "countryCode": "IS"
217
+ },
218
+ {
219
+ "inputLabel": "IN",
220
+ "label": "India",
83
221
  "value": "hi",
84
222
  "countryCode": "IN"
85
223
  },
86
224
  {
87
225
  "inputLabel": "ID",
88
- "label": "Indonesian",
226
+ "label": "Indonesia",
89
227
  "value": "id",
90
228
  "countryCode": "ID"
91
229
  },
230
+ {
231
+ "inputLabel": "IR",
232
+ "label": "Iran",
233
+ "value": "fa",
234
+ "countryCode": "IR"
235
+ },
236
+ {
237
+ "inputLabel": "IE",
238
+ "label": "Ireland",
239
+ "value": "ga",
240
+ "countryCode": "IE"
241
+ },
242
+ {
243
+ "inputLabel": "IL",
244
+ "label": "Israel",
245
+ "value": "he",
246
+ "countryCode": "IL"
247
+ },
248
+ {
249
+ "inputLabel": "IT",
250
+ "label": "Italy",
251
+ "value": "it",
252
+ "countryCode": "IT"
253
+ },
254
+ {
255
+ "inputLabel": "JP",
256
+ "label": "Japan",
257
+ "value": "ja",
258
+ "countryCode": "JP"
259
+ },
92
260
  {
93
261
  "inputLabel": "KN",
94
262
  "label": "Kannad",
@@ -96,11 +264,222 @@
96
264
  "countryCode": "IN"
97
265
  },
98
266
  {
99
- "inputLabel": "MS",
100
- "label": "Malay",
267
+ "inputLabel": "KZ",
268
+ "label": "Kazakhstan",
269
+ "value": "kk",
270
+ "countryCode": "KZ"
271
+ },
272
+ {
273
+ "inputLabel": "KG",
274
+ "label": "Kyrgyzstan",
275
+ "value": "ky",
276
+ "countryCode": "KG"
277
+ },
278
+ {
279
+ "inputLabel": "LA",
280
+ "label": "Laos",
281
+ "value": "lo",
282
+ "countryCode": "LA"
283
+ },
284
+ {
285
+ "inputLabel": "LV",
286
+ "label": "Latvia",
287
+ "value": "lv",
288
+ "countryCode": "LV"
289
+ },
290
+ {
291
+ "inputLabel": "LT",
292
+ "label": "Lithuania",
293
+ "value": "lt",
294
+ "countryCode": "LT"
295
+ },
296
+ {
297
+ "inputLabel": "LU",
298
+ "label": "Luxembourg",
299
+ "value": "lb",
300
+ "countryCode": "LU"
301
+ },
302
+ {
303
+ "inputLabel": "MK",
304
+ "label": "North Macedonia",
305
+ "value": "mk",
306
+ "countryCode": "MK"
307
+ },
308
+ {
309
+ "inputLabel": "MG",
310
+ "label": "Madagascar",
311
+ "value": "mg",
312
+ "countryCode": "MG"
313
+ },
314
+ {
315
+ "inputLabel": "MW",
316
+ "label": "Malawi",
317
+ "value": "ny",
318
+ "countryCode": "MW"
319
+ },
320
+ {
321
+ "inputLabel": "MY",
322
+ "label": "Malaysia",
101
323
  "value": "ms",
102
324
  "countryCode": "MY"
103
325
  },
326
+ {
327
+ "inputLabel": "MV",
328
+ "label": "Maldives",
329
+ "value": "dv",
330
+ "countryCode": "MV"
331
+ },
332
+ {
333
+ "inputLabel": "ML",
334
+ "label": "Mali",
335
+ "value": "bm",
336
+ "countryCode": "ML"
337
+ },
338
+ {
339
+ "inputLabel": "MT",
340
+ "label": "Malta",
341
+ "value": "mt",
342
+ "countryCode": "MT"
343
+ },
344
+ {
345
+ "inputLabel": "MH",
346
+ "label": "Marshall Islands",
347
+ "value": "mh",
348
+ "countryCode": "MH"
349
+ },
350
+ {
351
+ "inputLabel": "MN",
352
+ "label": "Mongolia",
353
+ "value": "mn",
354
+ "countryCode": "MN"
355
+ },
356
+ {
357
+ "inputLabel": "NR",
358
+ "label": "Nauru",
359
+ "value": "na",
360
+ "countryCode": "NR"
361
+ },
362
+ {
363
+ "inputLabel": "NP",
364
+ "label": "Nepal",
365
+ "value": "ne",
366
+ "countryCode": "NP"
367
+ },
368
+ {
369
+ "inputLabel": "NL",
370
+ "label": "Netherlands",
371
+ "value": "nl",
372
+ "countryCode": "NL"
373
+ },
374
+
375
+ {
376
+ "inputLabel": "NU",
377
+ "label": "Niue",
378
+ "value": "ni",
379
+ "countryCode": "NU"
380
+ },
381
+ {
382
+ "inputLabel": "NO",
383
+ "label": "Norway",
384
+ "value": "no",
385
+ "countryCode": "NO"
386
+ },
387
+ {
388
+ "inputLabel": "PK",
389
+ "label": "Pakistan",
390
+ "value": "ur",
391
+ "countryCode": "PK"
392
+ },
393
+ {
394
+ "inputLabel": "PW",
395
+ "label": "Palau",
396
+ "value": "pau",
397
+ "countryCode": "PW"
398
+ },
399
+ {
400
+ "inputLabel": "PY",
401
+ "label": "Paraguay",
402
+ "value": "gn",
403
+ "countryCode": "PY"
404
+ },
405
+ {
406
+ "inputLabel": "PH",
407
+ "label": "Philippines",
408
+ "value": "tl",
409
+ "countryCode": "PH"
410
+ },
411
+ {
412
+ "inputLabel": "PL",
413
+ "label": "Poland",
414
+ "value": "pl",
415
+ "countryCode": "PL"
416
+ },
417
+ {
418
+ "inputLabel": "PT",
419
+ "label": "Portugal",
420
+ "value": "pt",
421
+ "countryCode": "PT"
422
+ },
423
+ {
424
+ "inputLabel": "RO",
425
+ "label": "Romania",
426
+ "value": "ro",
427
+ "countryCode": "RO"
428
+ },
429
+ {
430
+ "inputLabel": "RU",
431
+ "label": "Russia",
432
+ "value": "ru",
433
+ "countryCode": "RU"
434
+ },
435
+ {
436
+ "inputLabel": "RW",
437
+ "label": "Rwanda",
438
+ "value": "rw",
439
+ "countryCode": "RW"
440
+ },
441
+ {
442
+ "inputLabel": "WS",
443
+ "label": "Samoa",
444
+ "value": "sm",
445
+ "countryCode": "WS"
446
+ },
447
+ {
448
+ "inputLabel": "RS",
449
+ "label": "Serbia",
450
+ "value": "sr",
451
+ "countryCode": "RS"
452
+ },
453
+ {
454
+ "inputLabel": "SA",
455
+ "label": "Saudi Arabia",
456
+ "value": "ar",
457
+ "countryCode": "SA"
458
+ },
459
+ {
460
+ "inputLabel": "SC",
461
+ "label": "Seychelles",
462
+ "value": "crs",
463
+ "countryCode": "SC"
464
+ },
465
+ {
466
+ "inputLabel": "SK",
467
+ "label": "Slovakia",
468
+ "value": "sk",
469
+ "countryCode": "SK"
470
+ },
471
+ {
472
+ "inputLabel": "SI",
473
+ "label": "Slovenia",
474
+ "value": "sl",
475
+ "countryCode": "SI"
476
+ },
477
+ {
478
+ "inputLabel": "SO",
479
+ "label": "Somalia",
480
+ "value": "so",
481
+ "countryCode": "SO"
482
+ },
104
483
  {
105
484
  "inputLabel": "TA",
106
485
  "label": "Tamil",
@@ -108,45 +487,111 @@
108
487
  "countryCode": "IN"
109
488
  },
110
489
  {
111
- "inputLabel": "AR",
112
- "label": "Arabic",
113
- "value": "ar",
114
- "countryCode": "EG"
490
+ "inputLabel": "ZA",
491
+ "label": "South Africa",
492
+ "value": "zu",
493
+ "countryCode": "ZA"
115
494
  },
116
495
  {
117
- "inputLabel": "RU",
118
- "label": "Russian",
119
- "value": "ru",
120
- "countryCode": "RU"
496
+ "inputLabel": "KR",
497
+ "label": "South Korea",
498
+ "value": "ko",
499
+ "countryCode": "KR"
121
500
  },
122
501
  {
123
- "inputLabel": "JA",
124
- "label": "Japanese",
125
- "value": "ja",
126
- "countryCode": "JP"
502
+ "inputLabel": "ES",
503
+ "label": "Spain",
504
+ "value": "es",
505
+ "countryCode": "ES"
127
506
  },
128
507
  {
129
- "inputLabel": "BN",
130
- "label": "Bengali",
131
- "value": "bn",
132
- "countryCode": "BD"
508
+ "inputLabel": "LK",
509
+ "label": "Sri Lanka",
510
+ "value": "si",
511
+ "countryCode": "LK"
133
512
  },
134
513
  {
135
- "inputLabel": "IT",
136
- "label": "Italian",
137
- "value": "it",
138
- "countryCode": "IT"
514
+ "inputLabel": "SE",
515
+ "label": "Sweden",
516
+ "value": "sv",
517
+ "countryCode": "SE"
139
518
  },
140
519
  {
141
- "inputLabel": "EL",
142
- "label": "Greek",
143
- "value": "el",
144
- "countryCode": "GR"
520
+ "inputLabel": "TJ",
521
+ "label": "Tajikistan",
522
+ "value": "tg",
523
+ "countryCode": "TJ"
145
524
  },
146
525
  {
147
- "inputLabel": "BG",
148
- "label": "Bulgarian Translation",
149
- "value": "bg",
150
- "countryCode": "BG"
526
+ "inputLabel": "TZ",
527
+ "label": "Tanzania",
528
+ "value": "sw",
529
+ "countryCode": "TZ"
530
+ },
531
+ {
532
+ "inputLabel": "TH",
533
+ "label": "Thailand",
534
+ "value": "th",
535
+ "countryCode": "TH"
536
+ },
537
+ {
538
+ "inputLabel": "TK",
539
+ "label": "Tokelau",
540
+ "value": "tkl",
541
+ "countryCode": "TK"
542
+ },
543
+ {
544
+ "inputLabel": "TO",
545
+ "label": "Tonga",
546
+ "value": "to",
547
+ "countryCode": "TO"
548
+ },
549
+ {
550
+ "inputLabel": "TR",
551
+ "label": "Turkey",
552
+ "value": "tr",
553
+ "countryCode": "TR"
554
+ },
555
+ {
556
+ "inputLabel": "TM",
557
+ "label": "Turkmenistan",
558
+ "value": "tk",
559
+ "countryCode": "TM"
560
+ },
561
+ {
562
+ "inputLabel": "UA",
563
+ "label": "Ukraine",
564
+ "value": "uk",
565
+ "countryCode": "UA"
566
+ },
567
+ {
568
+ "inputLabel": "UZ",
569
+ "label": "Uzbekistan",
570
+ "value": "uz",
571
+ "countryCode": "UZ"
572
+ },
573
+ {
574
+ "inputLabel": "VU",
575
+ "label": "Vanuatu",
576
+ "value": "bi",
577
+ "countryCode": "VU"
578
+ },
579
+ {
580
+ "inputLabel": "VN",
581
+ "label": "Vietnam",
582
+ "value": "vi",
583
+ "countryCode": "VN"
584
+ },
585
+ {
586
+ "inputLabel": "ZW",
587
+ "label": "Zimbabwe",
588
+ "value": "sn",
589
+ "countryCode": "ZW"
590
+ },
591
+ {
592
+ "inputLabel": "ZH-CN",
593
+ "label": "Chinese Simplified",
594
+ "value": "zh-CN",
595
+ "countryCode": "CN"
151
596
  }
152
597
  ]
@@ -1,5 +1,5 @@
1
- import React, { useState } from 'react'
2
- import { View, Animated, StyleSheet, Platform, TouchableOpacity } from 'react-native'
1
+ import React, { useEffect, useState } from 'react'
2
+ import { View, Animated, StyleSheet, TouchableOpacity } from 'react-native'
3
3
  import { useUtils, useLanguage, useOrder } from 'ordering-components/native'
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
@@ -47,25 +47,34 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
47
47
 
48
48
  const pickerStyle = StyleSheet.create({
49
49
  inputAndroid: {
50
- width: 34,
50
+ width: 45,
51
51
  textAlign: 'center',
52
52
  overflow: 'visible',
53
53
  fontSize: 12,
54
- height: 20,
55
- padding: 0,
56
- color: theme.colors.textNormal
54
+ height: 30,
55
+ color: theme.colors.textNormal,
56
+ backgroundColor: theme.colors.backgroundGray100,
57
+ paddingVertical: 8,
58
+ paddingRight: 10,
59
+ paddingLeft: 0,
60
+ borderRadius: 7.6,
57
61
  },
58
62
  inputIOS: {
59
- width: 34,
63
+ width: 45,
60
64
  textAlign: 'center',
61
65
  overflow: 'visible',
62
66
  fontSize: 12,
67
+ backgroundColor: theme.colors.backgroundGray100,
68
+ paddingVertical: 8,
69
+ paddingRight: 15,
70
+ paddingLeft: 0,
71
+ borderRadius: 7.6,
63
72
  },
64
73
  icon: {
65
74
  position: 'absolute',
66
75
  zIndex: 1,
67
- top: -4,
68
- end: -4,
76
+ top: 0,
77
+ end: 8,
69
78
  },
70
79
  placeholder: {
71
80
  color: theme.colors.secundaryContrast
@@ -79,9 +88,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
79
88
 
80
89
  const [isActive, setActiveState] = useState(false)
81
90
  const [isServiceOpen, setIsServiceOpen] = useState(false)
82
- const [productQuantityState, setProductQuantityState] = useState(product.quantity.toString())
83
- // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
84
- // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
91
+ const [productQuantityState, setProductQuantityState] = useState<any>(product.quantity.toString())
85
92
 
86
93
  const productInfo = () => {
87
94
  if (isCartProduct) {
@@ -109,20 +116,6 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
109
116
  setIsServiceOpen(true)
110
117
  }
111
118
 
112
- /* const toggleAccordion = () => {
113
- if ((!product?.valid_menu && isCartProduct)) return
114
- if (isActive) {
115
- Animated.timing(setHeight.height, {
116
- toValue: 100,
117
- duration: 500,
118
- easing: Easing.linear,
119
- useNativeDriver: false,
120
- }).start()
121
- } else {
122
- setHeightState({height: new Animated.Value(0)})
123
- }
124
- }*/
125
-
126
119
  const handleChangeQuantity = (value: string) => {
127
120
  if (!orderState.loading) {
128
121
  setProductQuantityState(value)
@@ -139,10 +132,6 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
139
132
  return `${quantity} x ${name} ${pos} +${price}`
140
133
  }
141
134
 
142
- /*useEffect(() => {
143
- toggleAccordion()
144
- }, [isActive])*/
145
-
146
135
  const productOptions = getProductMax && [...Array(getProductMax(product) + 1),].map((_: any, opt: number) => {
147
136
  return {
148
137
  label: opt === 0 ? t('REMOVE', 'Remove') : opt.toString(),
@@ -150,15 +139,23 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
150
139
  }
151
140
  })
152
141
 
142
+ useEffect(() => {
143
+ if (product.quantity.toString() === productQuantityState || productQuantityState) {
144
+ setProductQuantityState(null)
145
+ }
146
+ }, [product.quantity])
147
+
153
148
  return (
154
149
  <>
155
150
  <AccordionSection>
156
151
  <Accordion
157
- isValid={product?.valid ?? true}
158
- onPress={() => (!product?.valid_menu && isCartProduct)
159
- ? {}
160
- : setActiveState(!isActive)}
161
152
  activeOpacity={1}
153
+ isValid={product?.valid ?? true}
154
+ onPress={
155
+ (!product?.valid_menu && isCartProduct) ||
156
+ !(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || !!product.comment)
157
+ ? null : () => setActiveState(!isActive)
158
+ }
162
159
  >
163
160
  <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
164
161
  <ContentInfo>
@@ -215,16 +212,20 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
215
212
  <RNPickerSelect
216
213
  items={productOptions}
217
214
  onValueChange={handleChangeQuantity}
218
- value={productQuantityState}
215
+ value={productQuantityState ?? product.quantity.toString()}
219
216
  style={pickerStyle}
220
217
  useNativeAndroidPickerStyle={false}
221
218
  placeholder={{}}
222
- touchableWrapperProps={{
223
- style: {
224
- width: 40,
225
- }
226
- }}
227
- Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
219
+ touchableWrapperProps={{ style: { width: 45 } }}
220
+ Icon={() => (
221
+ <View style={pickerStyle.icon}>
222
+ <OIcon
223
+ src={theme.images.general.arrow_down}
224
+ color={theme.colors.textNormal}
225
+ width={8}
226
+ />
227
+ </View>
228
+ )}
228
229
  disabled={orderState.loading}
229
230
  />
230
231
  </ProductInfo>
@@ -17,9 +17,6 @@ export const Accordion = styled.TouchableOpacity`
17
17
 
18
18
  export const ProductInfo = styled.View`
19
19
  margin-horizontal: 7px;
20
- background-color: ${(props: any) => props.theme.colors.backgroundGray100};
21
- padding: 4px 12px 4px 0px;
22
- border-radius: 7.6px;
23
20
  `
24
21
 
25
22
  export const ProductQuantity = styled.View`