ordering-ui-react-native 0.23.38 → 0.23.40

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.23.38",
3
+ "version": "0.23.40",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -31,7 +31,7 @@ import { FloatingButton } from '../FloatingButton';
31
31
  import { GoogleMap } from '../GoogleMap';
32
32
  import { OButton, OModal, OText, OIcon } from '../shared';
33
33
  import { OrderDetailsParams } from '../../types';
34
- import { verifyDecimals, getProductPrice, getOrderStatus } from '../../utils';
34
+ import { verifyDecimals, getProductPrice, getOrderStatus, getCurrenySymbol } from '../../utils';
35
35
  import { USER_TYPE } from '../../config/constants';
36
36
  import CountryPicker from 'react-native-country-picker-modal';
37
37
  import { NotFoundSource } from '../NotFoundSource';
@@ -146,8 +146,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
146
146
  if (name !== 'No') {
147
147
  const pos = position && position !== 'whole' ? `(${t(position.toUpperCase(), position)})` : '';
148
148
  return pos
149
- ? `${quantity} x ${name} ${pos} +${parsePrice(price)}\n`
150
- : `${quantity} x ${name} +${parsePrice(price)}\n`;
149
+ ? `${quantity} x ${name} ${pos} +${parsePrice(price, { currency: getCurrenySymbol(order?.currency) })}\n`
150
+ : `${quantity} x ${name} +${parsePrice(price, { currency: getCurrenySymbol(order?.currency) })}\n`;
151
151
  } else {
152
152
  return 'No\n';
153
153
  }
@@ -255,7 +255,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
255
255
  order?.products.length &&
256
256
  order?.products.map((product: any, i: number) => {
257
257
  const string =
258
- `${product?.quantity} X ${product?.name} ${parsePrice(product.total ?? getProductPrice(product))}\n${getOptions(product.options, product.comment)}`;
258
+ `${product?.quantity} X ${product?.name} ${parsePrice(product.total ?? getProductPrice(product), { currency: getCurrenySymbol(order?.currency) })}\n${getOptions(product.options, product.comment)}`;
259
259
 
260
260
  return i === 0 ? ` ${string}` : string
261
261
  });
@@ -267,20 +267,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
267
267
  )}:\n${productsInString}\n`;
268
268
 
269
269
  const subtotal = `${t('SUBTOTAL', 'Subtotal')}: ${parsePrice(
270
- order?.subtotal,
270
+ order?.subtotal,
271
+ { currency: getCurrenySymbol(order?.currency) }
271
272
  )}\n`;
272
273
 
273
274
  const drivertip = `${t('DRIVER_TIP', 'Driver tip')} ${parsePrice(
274
275
  order?.summary?.driver_tip || order?.totalDriverTip,
276
+ { currency: getCurrenySymbol(order?.currency) }
275
277
  )}\n`;
276
278
 
277
279
  const deliveryFee = `${t('DELIVERY_FEE', 'Delivery fee')} ${verifyDecimals(
278
280
  order?.service_fee,
279
281
  parseNumber,
280
- )}% ${parsePrice(order?.summary?.service_fee || order?.serviceFee || 0)}\n`;
282
+ )}% ${parsePrice(order?.summary?.service_fee || order?.serviceFee || 0, { currency: getCurrenySymbol(order?.currency) })}\n`;
281
283
 
282
284
  const total = `${t('TOTAL', 'Total')} ${parsePrice(
283
285
  order?.summary?.total || order?.total,
286
+ { currency: getCurrenySymbol(order?.currency) }
284
287
  )}\n`;
285
288
 
286
289
  const orderStatus = `${t('INVOICE_ORDER_NO', 'Order No.')} ${order.id} ${t(
@@ -18,7 +18,7 @@ import {
18
18
 
19
19
  import { ProductItemAccordion } from '../ProductItemAccordion';
20
20
 
21
- import { verifyDecimals, calculateDistance, transformDistance } from '../../utils';
21
+ import { verifyDecimals, calculateDistance, transformDistance, getCurrenySymbol } from '../../utils';
22
22
 
23
23
  import {
24
24
  useLanguage,
@@ -469,7 +469,7 @@ export const OrderContentComponent = (props: OrderContent) => {
469
469
  <Table>
470
470
  <OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
471
471
  <OText mBottom={4}>
472
- {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
472
+ {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: getCurrenySymbol(order?.currency) })}
473
473
  </OText>
474
474
  </Table>
475
475
  {(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
@@ -482,7 +482,7 @@ export const OrderContentComponent = (props: OrderContent) => {
482
482
  ) : (
483
483
  <OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
484
484
  )}
485
- <OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</OText>
485
+ <OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
486
486
  </Table>
487
487
  )}
488
488
  {
@@ -496,7 +496,7 @@ export const OrderContentComponent = (props: OrderContent) => {
496
496
  )}
497
497
  </OText>
498
498
  </OSRow>
499
- <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
499
+ <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
500
500
  </Table>
501
501
  ))
502
502
  }
@@ -504,9 +504,9 @@ export const OrderContentComponent = (props: OrderContent) => {
504
504
  <Table>
505
505
  <OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
506
506
  {order?.tax_type === 1 ? (
507
- <OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</OText>
507
+ <OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: getCurrenySymbol(order?.currency) })}</OText>
508
508
  ) : (
509
- <OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</OText>
509
+ <OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
510
510
  )}
511
511
  </Table>
512
512
  )}
@@ -516,7 +516,7 @@ export const OrderContentComponent = (props: OrderContent) => {
516
516
  {t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
517
517
  </OText>
518
518
  <OText mBottom={4}>
519
- {parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}
519
+ {parsePrice(order?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}
520
520
  </OText>
521
521
  </Table>
522
522
  )}
@@ -527,7 +527,7 @@ export const OrderContentComponent = (props: OrderContent) => {
527
527
  {t('SERVICE_FEE', 'Service fee')}
528
528
  {`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
529
529
  </OText>
530
- <OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</OText>
530
+ <OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
531
531
  </Table>
532
532
  )
533
533
  }
@@ -540,7 +540,7 @@ export const OrderContentComponent = (props: OrderContent) => {
540
540
  {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
541
541
  </OText>
542
542
  </OSRow>
543
- <OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</OText>
543
+ <OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
544
544
  </Table>
545
545
  ))
546
546
  }
@@ -550,10 +550,10 @@ export const OrderContentComponent = (props: OrderContent) => {
550
550
  <OSRow>
551
551
  <OText mBottom={4}>
552
552
  {t(fee?.name?.toUpperCase?.()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
553
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency })} + `}{fee.percentage}%){' '}
553
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: getCurrenySymbol(order?.currency) })} + `}{fee.percentage}%){' '}
554
554
  </OText>
555
555
  </OSRow>
556
- <OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</OText>
556
+ <OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
557
557
  </Table>
558
558
  ))
559
559
  }
@@ -568,7 +568,7 @@ export const OrderContentComponent = (props: OrderContent) => {
568
568
  )}
569
569
  </OText>
570
570
  </OSRow>
571
- <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
571
+ <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
572
572
  </Table>
573
573
  ))
574
574
  }
@@ -580,7 +580,7 @@ export const OrderContentComponent = (props: OrderContent) => {
580
580
  </OText>
581
581
 
582
582
  <OText mBottom={4}>
583
- {parsePrice(order?.summary?.delivery_price + getIncludedTaxes(true), { currency: order?.currency })}
583
+ {parsePrice(order?.summary?.delivery_price + getIncludedTaxes(true), { currency: getCurrenySymbol(order?.currency) })}
584
584
  </OText>
585
585
  </Table>
586
586
  )
@@ -594,7 +594,7 @@ export const OrderContentComponent = (props: OrderContent) => {
594
594
  {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}
595
595
  </OText>
596
596
  </OSRow>
597
- <OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
597
+ <OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}</OText>
598
598
  </Table>
599
599
  ))
600
600
  }
@@ -605,11 +605,11 @@ export const OrderContentComponent = (props: OrderContent) => {
605
605
  <OText mBottom={4}>
606
606
  {t(offer.name?.toUpperCase?.()?.replace(/ /g, '_'), offer.name)}
607
607
  {offer.rate_type === 1 && (
608
- <OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
608
+ <OText>{`(${verifyDecimals(offer?.rate, parsePrice, { currency: getCurrenySymbol(order?.currency) })}%)`}</OText>
609
609
  )}
610
610
  </OText>
611
611
  </OSRow>
612
- <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
612
+ <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}</OText>
613
613
  </Table>
614
614
  ))
615
615
  }
@@ -623,7 +623,7 @@ export const OrderContentComponent = (props: OrderContent) => {
623
623
  `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
624
624
  )}
625
625
  </OText>
626
- <OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
626
+ <OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: getCurrenySymbol(order?.currency) })}</OText>
627
627
  </Table>
628
628
  )}
629
629
 
@@ -637,7 +637,7 @@ export const OrderContentComponent = (props: OrderContent) => {
637
637
  mBottom={4}
638
638
  style={styles.textBold}
639
639
  color={theme.colors.primary}>
640
- {parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency })}
640
+ {parsePrice(order?.summary?.total ?? order?.total, { currency: getCurrenySymbol(order?.currency) })}
641
641
  </OText>
642
642
  </Table>
643
643
  </Total>
@@ -680,8 +680,8 @@ export const OrderContentComponent = (props: OrderContent) => {
680
680
  </View>
681
681
  <OText>
682
682
  {(event?.paymethod?.gateway === 'cash' && order?.cash)
683
- ? parsePrice(order?.cash, { currency: order?.currency })
684
- : `-${parsePrice(event?.amount, { currency: order?.currency })}`}
683
+ ? parsePrice(order?.cash, { currency: getCurrenySymbol(order?.currency) })
684
+ : `-${parsePrice(event?.amount, { currency: getCurrenySymbol(order?.currency) })}`}
685
685
  </OText>
686
686
  </View>
687
687
  ))}
@@ -22,6 +22,7 @@ import {
22
22
  } from './styles';
23
23
  import { OText, OAlert } from '../shared';
24
24
  import { ProductItemAccordionParams } from '../../types';
25
+ import { getCurrenySymbol } from '../../utils';
25
26
 
26
27
  export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
27
28
  const {
@@ -160,7 +161,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
160
161
  }}>
161
162
  <View style={{ flexDirection: 'row' }}>
162
163
  <OText size={12} color={theme.colors.textGray}>
163
- {parsePrice(getProductPrice(product), { currency })}
164
+ {parsePrice(getProductPrice(product), { currency: getCurrenySymbol(currency) })}
164
165
  </OText>
165
166
 
166
167
  {(
@@ -281,7 +282,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
281
282
  suboption.position,
282
283
  )
283
284
  : '',
284
- price: parsePrice(suboption.price, { currency }),
285
+ price: parsePrice(suboption.price, { currency: getCurrenySymbol(currency) }),
285
286
  })}
286
287
  </OText>
287
288
  </ProductSubOption>
@@ -0,0 +1,1010 @@
1
+ export const CURRENCY = {
2
+ AED: {
3
+ name: 'United Arab Emirates Dirham',
4
+ symbol: 'د.إ.‏',
5
+ decimals: 2,
6
+ code: 'AED'
7
+ },
8
+ AFN: {
9
+ name: 'Afghan Afghani',
10
+ symbol: '؋',
11
+ decimals: 2,
12
+ code: 'AFN'
13
+ },
14
+ ALL: {
15
+ name: 'Albanian Lek',
16
+ symbol: 'Lek',
17
+ decimals: 2,
18
+ code: 'ALL'
19
+ },
20
+ AMD: {
21
+ name: 'Armenian Dram',
22
+ symbol: 'դր.',
23
+ decimals: 2,
24
+ code: 'AMD'
25
+ },
26
+ ANG: {
27
+ name: 'Netherlands Antillean Gulden',
28
+ symbol: 'ƒ',
29
+ decimals: 2,
30
+ code: 'ANG'
31
+ },
32
+ AOA: {
33
+ name: 'Angolan Kwanza',
34
+ symbol: 'Kz',
35
+ decimals: 2,
36
+ code: 'AOA'
37
+ },
38
+ ARS: {
39
+ name: 'Argentine Peso',
40
+ symbol: '$',
41
+ decimals: 2,
42
+ code: 'ARS'
43
+ },
44
+ AUD: {
45
+ name: 'Australian Dollar',
46
+ symbol: '$',
47
+ decimals: 2,
48
+ code: 'AUD'
49
+ },
50
+ AWG: {
51
+ name: 'Aruban Florin',
52
+ symbol: 'Afl.',
53
+ decimals: 2,
54
+ code: 'AWG'
55
+ },
56
+ AZN: {
57
+ name: 'Azerbaijani Manat',
58
+ symbol: 'ман.',
59
+ decimals: 2,
60
+ code: 'AZN'
61
+ },
62
+ BAM: {
63
+ name: 'Bosnia and Herzegovina Convertible Mark',
64
+ symbol: 'KM',
65
+ decimals: 2,
66
+ code: 'BAM'
67
+ },
68
+ BBD: {
69
+ name: 'Barbadian Dollar',
70
+ symbol: '$',
71
+ decimals: 2,
72
+ code: 'BBD'
73
+ },
74
+ BDT: {
75
+ name: 'Bangladeshi Taka',
76
+ symbol: '৳',
77
+ decimals: 2,
78
+ code: 'BDT'
79
+ },
80
+ BGN: {
81
+ name: 'Bulgarian Lev',
82
+ symbol: 'лв.',
83
+ decimals: 2,
84
+ code: 'BGN'
85
+ },
86
+ BHD: {
87
+ name: 'Bahraini Dinar',
88
+ symbol: 'د.ب.‏',
89
+ decimals: 3,
90
+ code: 'BHD'
91
+ },
92
+ BIF: {
93
+ name: 'Burundian Franc',
94
+ symbol: 'FBu',
95
+ decimals: 0,
96
+ code: 'BIF'
97
+ },
98
+ BMD: {
99
+ name: 'Bermudian Dollar',
100
+ symbol: '$',
101
+ decimals: 2,
102
+ code: 'BMD'
103
+ },
104
+ BND: {
105
+ name: 'Brunei Dollar',
106
+ symbol: '$',
107
+ decimals: 2,
108
+ code: 'BND'
109
+ },
110
+ BOB: {
111
+ name: 'Bolivian Boliviano',
112
+ symbol: 'Bs',
113
+ decimals: 2,
114
+ code: 'BOB'
115
+ },
116
+ BRL: {
117
+ name: 'Brazilian Real',
118
+ symbol: 'R$',
119
+ decimals: 2,
120
+ code: 'BRL'
121
+ },
122
+ BSD: {
123
+ name: 'Bahamian Dollar',
124
+ symbol: '$',
125
+ decimals: 2,
126
+ code: 'BSD'
127
+ },
128
+ BTC: {
129
+ name: 'Bitcoin',
130
+ symbol: '₿',
131
+ decimals: 8,
132
+ code: 'BTC'
133
+ },
134
+ BTN: {
135
+ name: 'Bhutanese Ngultrum',
136
+ symbol: 'Nu.',
137
+ decimals: 2,
138
+ code: 'BTN'
139
+ },
140
+ BWP: {
141
+ name: 'Botswana Pula',
142
+ symbol: 'P',
143
+ decimals: 2,
144
+ code: 'BWP'
145
+ },
146
+ BYN: {
147
+ name: 'Belarusian Ruble',
148
+ symbol: 'Br',
149
+ decimals: 2,
150
+ code: 'BYN'
151
+ },
152
+ BYR: {
153
+ name: 'Belarusian Ruble',
154
+ symbol: 'Br',
155
+ decimals: 0,
156
+ code: 'BYR'
157
+ },
158
+ BZD: {
159
+ name: 'Belize Dollar',
160
+ symbol: '$',
161
+ decimals: 2,
162
+ code: 'BZD'
163
+ },
164
+ CAD: {
165
+ name: 'Canadian Dollar',
166
+ symbol: '$',
167
+ decimals: 2,
168
+ code: 'CAD'
169
+ },
170
+ CDF: {
171
+ name: 'Congolese Franc',
172
+ symbol: 'FC',
173
+ decimals: 2,
174
+ code: 'CDF'
175
+ },
176
+ CHF: {
177
+ name: 'Swiss Franc',
178
+ symbol: 'Fr.',
179
+ decimals: 2,
180
+ code: 'CHF'
181
+ },
182
+ CLF: {
183
+ name: 'Unidad de Fomento',
184
+ decimals: 4,
185
+ code: 'CLF',
186
+ symbol: 'UF'
187
+ },
188
+ CLP: {
189
+ name: 'Chilean Peso',
190
+ symbol: '$',
191
+ decimals: 0,
192
+ code: 'CLP'
193
+ },
194
+ CNY: {
195
+ name: 'Chinese Renminbi Yuan',
196
+ symbol: '¥',
197
+ decimals: 2,
198
+ code: 'CNY'
199
+ },
200
+ COP: {
201
+ name: 'Colombian Peso',
202
+ symbol: '$',
203
+ decimals: 2,
204
+ code: 'COP'
205
+ },
206
+ CRC: {
207
+ name: 'Costa Rican Colón',
208
+ symbol: '₡',
209
+ decimals: 2,
210
+ code: 'CRC'
211
+ },
212
+ CUC: {
213
+ name: 'Cuban Convertible Peso',
214
+ decimals: 2,
215
+ code: 'CUC',
216
+ symbol: '$'
217
+ },
218
+ CVE: {
219
+ name: 'Cape Verdean Escudo',
220
+ symbol: '$',
221
+ decimals: 2,
222
+ code: 'CVE'
223
+ },
224
+ CZK: {
225
+ name: 'Czech Koruna',
226
+ symbol: 'Kč',
227
+ decimals: 2,
228
+ code: 'CZK'
229
+ },
230
+ DJF: {
231
+ name: 'Djiboutian Franc',
232
+ symbol: 'Fdj',
233
+ decimals: 0,
234
+ code: 'DJF'
235
+ },
236
+ DKK: {
237
+ name: 'Danish Krone',
238
+ symbol: 'kr',
239
+ decimals: 2,
240
+ code: 'DKK'
241
+ },
242
+ DOP: {
243
+ name: 'Dominican Peso',
244
+ symbol: '$',
245
+ decimals: 2,
246
+ code: 'DOP'
247
+ },
248
+ DZD: {
249
+ name: 'Algerian Dinar',
250
+ symbol: 'د.ج.‏',
251
+ decimals: 2,
252
+ code: 'DZD'
253
+ },
254
+ EEK: {
255
+ name: 'Estonian Kroon',
256
+ symbol: 'kr',
257
+ decimals: 2,
258
+ code: 'EEK'
259
+ },
260
+ EGP: {
261
+ name: 'Egyptian Pound',
262
+ symbol: 'ج.م.‏',
263
+ decimals: 2,
264
+ code: 'EGP'
265
+ },
266
+ ERN: {
267
+ name: 'Eritrean Nakfa',
268
+ symbol: 'Nfk',
269
+ decimals: 2,
270
+ code: 'ERN'
271
+ },
272
+ ETB: {
273
+ name: 'Ethiopian Birr',
274
+ symbol: 'Br',
275
+ decimals: 2,
276
+ code: 'ETB'
277
+ },
278
+ EUR: {
279
+ name: 'Euro',
280
+ symbol: '€',
281
+ decimals: 2,
282
+ code: 'EUR'
283
+ },
284
+ FJD: {
285
+ name: 'Fijian Dollar',
286
+ symbol: '$',
287
+ decimals: 2,
288
+ code: 'FJD'
289
+ },
290
+ FKP: {
291
+ name: 'Falkland Pound',
292
+ symbol: '£',
293
+ decimals: 2,
294
+ code: 'FKP'
295
+ },
296
+ GBP: {
297
+ name: 'British Pound',
298
+ symbol: '£',
299
+ decimals: 2,
300
+ code: 'GBP'
301
+ },
302
+ GEL: {
303
+ name: 'Georgian Lari',
304
+ symbol: 'ლ',
305
+ decimals: 2,
306
+ code: 'GEL'
307
+ },
308
+ GGP: {
309
+ name: 'Guernsey Pound',
310
+ decimals: 2,
311
+ code: 'GGP',
312
+ symbol: '£'
313
+ },
314
+ GHS: {
315
+ name: 'Ghanaian Cedi',
316
+ symbol: 'GH₵',
317
+ decimals: 2,
318
+ code: 'GHS'
319
+ },
320
+ GIP: {
321
+ name: 'Gibraltar Pound',
322
+ symbol: '£',
323
+ decimals: 2,
324
+ code: 'GIP'
325
+ },
326
+ GMD: {
327
+ name: 'Gambian Dalasi',
328
+ decimals: 2,
329
+ code: 'GMD',
330
+ symbol: 'D'
331
+ },
332
+ GNF: {
333
+ name: 'Guinean Franc',
334
+ symbol: 'FG',
335
+ decimals: 0,
336
+ code: 'GNF'
337
+ },
338
+ GTQ: {
339
+ name: 'Guatemalan Quetzal',
340
+ symbol: 'Q',
341
+ decimals: 2,
342
+ code: 'GTQ'
343
+ },
344
+ GYD: {
345
+ name: 'Guyanese Dollar',
346
+ decimals: 2,
347
+ code: 'GYD',
348
+ symbol: '$'
349
+ },
350
+ HKD: {
351
+ name: 'Hong Kong Dollar',
352
+ symbol: '$',
353
+ decimals: 2,
354
+ code: 'HKD'
355
+ },
356
+ HNL: {
357
+ name: 'Honduran Lempira',
358
+ symbol: 'L',
359
+ decimals: 2,
360
+ code: 'HNL'
361
+ },
362
+ HRK: {
363
+ name: 'Croatian Kuna',
364
+ symbol: 'kn',
365
+ decimals: 2,
366
+ code: 'HRK'
367
+ },
368
+ HTG: {
369
+ name: 'Haitian Gourde',
370
+ decimals: 2,
371
+ code: 'HTG',
372
+ symbol: 'G'
373
+ },
374
+ HUF: {
375
+ name: 'Hungarian Forint',
376
+ symbol: 'Ft',
377
+ decimals: 0,
378
+ code: 'HUF'
379
+ },
380
+ IDR: {
381
+ name: 'Indonesian Rupiah',
382
+ symbol: 'Rp',
383
+ decimals: 2,
384
+ code: 'IDR'
385
+ },
386
+ ILS: {
387
+ name: 'Israeli New Sheqel',
388
+ symbol: '₪',
389
+ decimals: 2,
390
+ code: 'ILS'
391
+ },
392
+ IMP: {
393
+ name: 'Isle of Man Pound',
394
+ decimals: 2,
395
+ code: 'IMP',
396
+ symbol: '£'
397
+ },
398
+ INR: {
399
+ name: 'Indian Rupee',
400
+ symbol: 'টকা',
401
+ decimals: 2,
402
+ code: 'INR'
403
+ },
404
+ IQD: {
405
+ name: 'Iraqi Dinar',
406
+ symbol: 'د.ع.‏',
407
+ decimals: 3,
408
+ code: 'IQD'
409
+ },
410
+ ISK: {
411
+ name: 'Icelandic Króna',
412
+ symbol: 'kr',
413
+ decimals: 0,
414
+ code: 'ISK'
415
+ },
416
+ JEP: {
417
+ name: 'Jersey Pound',
418
+ decimals: 2,
419
+ code: 'JEP',
420
+ symbol: '£'
421
+ },
422
+ JMD: {
423
+ name: 'Jamaican Dollar',
424
+ symbol: '$',
425
+ decimals: 2,
426
+ code: 'JMD'
427
+ },
428
+ JOD: {
429
+ name: 'Jordanian Dinar',
430
+ symbol: 'د.أ.‏',
431
+ decimals: 3,
432
+ code: 'JOD'
433
+ },
434
+ JPY: {
435
+ name: 'Japanese Yen',
436
+ symbol: '¥',
437
+ decimals: 0,
438
+ code: 'JPY'
439
+ },
440
+ KES: {
441
+ name: 'Kenyan Shilling',
442
+ symbol: 'Ksh',
443
+ decimals: 2,
444
+ code: 'KES'
445
+ },
446
+ KGS: {
447
+ name: 'Kyrgyzstani Som',
448
+ decimals: 2,
449
+ code: 'KGS',
450
+ symbol: 'som'
451
+ },
452
+ KHR: {
453
+ name: 'Cambodian Riel',
454
+ symbol: '៛',
455
+ decimals: 2,
456
+ code: 'KHR'
457
+ },
458
+ KMF: {
459
+ name: 'Comorian Franc',
460
+ symbol: 'FC',
461
+ decimals: 0,
462
+ code: 'KMF'
463
+ },
464
+ KRW: {
465
+ name: 'South Korean Won',
466
+ symbol: '₩',
467
+ decimals: 0,
468
+ code: 'KRW'
469
+ },
470
+ KWD: {
471
+ name: 'Kuwaiti Dinar',
472
+ symbol: 'د.ك.‏',
473
+ decimals: 3,
474
+ code: 'KWD'
475
+ },
476
+ KYD: {
477
+ name: 'Cayman Islands Dollar',
478
+ decimals: 2,
479
+ code: 'KYD',
480
+ symbol: '$'
481
+ },
482
+ KZT: {
483
+ name: 'Kazakhstani Tenge',
484
+ symbol: 'тңг.',
485
+ decimals: 2,
486
+ code: 'KZT'
487
+ },
488
+ LAK: {
489
+ name: 'Lao Kip',
490
+ decimals: 2,
491
+ code: 'LAK',
492
+ symbol: '₭'
493
+ },
494
+ LBP: {
495
+ name: 'Lebanese Pound',
496
+ symbol: 'ل.ل.‏',
497
+ decimals: 2,
498
+ code: 'LBP'
499
+ },
500
+ LKR: {
501
+ name: 'Sri Lankan Rupee',
502
+ symbol: 'රු',
503
+ decimals: 2,
504
+ code: 'LKR'
505
+ },
506
+ LRD: {
507
+ name: 'Liberian Dollar',
508
+ decimals: 2,
509
+ code: 'LRD',
510
+ symbol: '$'
511
+ },
512
+ LSL: {
513
+ name: 'Lesotho Loti',
514
+ decimals: 2,
515
+ code: 'LSL',
516
+ symbol: 'L'
517
+ },
518
+ LTL: {
519
+ name: 'Lithuanian Litas',
520
+ symbol: 'Lt',
521
+ decimals: 2,
522
+ code: 'LTL'
523
+ },
524
+ LVL: {
525
+ name: 'Latvian Lats',
526
+ symbol: 'Ls',
527
+ decimals: 2,
528
+ code: 'LVL'
529
+ },
530
+ LYD: {
531
+ name: 'Libyan Dinar',
532
+ symbol: 'د.ل.‏',
533
+ decimals: 3,
534
+ code: 'LYD'
535
+ },
536
+ MAD: {
537
+ name: 'Moroccan Dirham',
538
+ symbol: 'د.م.‏',
539
+ decimals: 2,
540
+ code: 'MAD'
541
+ },
542
+ MDL: {
543
+ name: 'Moldovan Leu',
544
+ symbol: 'MDL',
545
+ decimals: 2,
546
+ code: 'MDL'
547
+ },
548
+ MGA: {
549
+ name: 'Malagasy Ariary',
550
+ symbol: 'MGA',
551
+ decimals: 0,
552
+ code: 'MGA'
553
+ },
554
+ MKD: {
555
+ name: 'Macedonian Denar',
556
+ symbol: 'ден',
557
+ decimals: 2,
558
+ code: 'MKD'
559
+ },
560
+ MMK: {
561
+ name: 'Myanmar Kyat',
562
+ symbol: 'K',
563
+ decimals: 2,
564
+ code: 'MMK'
565
+ },
566
+ MNT: {
567
+ name: 'Mongolian Tögrög',
568
+ decimals: 2,
569
+ code: 'MNT',
570
+ symbol: '₮'
571
+ },
572
+ MOP: {
573
+ name: 'Macanese Pataca',
574
+ symbol: 'MOP$',
575
+ decimals: 2,
576
+ code: 'MOP'
577
+ },
578
+ MRO: {
579
+ name: 'Mauritanian Ouguiya',
580
+ decimals: 0,
581
+ code: 'MRO',
582
+ symbol: 'UM'
583
+ },
584
+ MTL: {
585
+ name: 'Maltese Lira',
586
+ decimals: 2,
587
+ code: 'MTL',
588
+ symbol: '₤'
589
+ },
590
+ MUR: {
591
+ name: 'Mauritian Rupee',
592
+ symbol: 'MURs',
593
+ decimals: 2,
594
+ code: 'MUR'
595
+ },
596
+ MVR: {
597
+ name: 'Maldivian Rufiyaa',
598
+ decimals: 2,
599
+ code: 'MVR',
600
+ symbol: 'Rf'
601
+ },
602
+ MWK: {
603
+ name: 'Malawian Kwacha',
604
+ decimals: 2,
605
+ code: 'MWK',
606
+ symbol: 'MK'
607
+ },
608
+ MXN: {
609
+ name: 'Mexican Peso',
610
+ symbol: '$',
611
+ decimals: 2,
612
+ code: 'MXN'
613
+ },
614
+ MYR: {
615
+ name: 'Malaysian Ringgit',
616
+ symbol: 'RM',
617
+ decimals: 2,
618
+ code: 'MYR'
619
+ },
620
+ MZN: {
621
+ name: 'Mozambican Metical',
622
+ symbol: 'MTn',
623
+ decimals: 2,
624
+ code: 'MZN'
625
+ },
626
+ NAD: {
627
+ name: 'Namibian Dollar',
628
+ symbol: '$',
629
+ decimals: 2,
630
+ code: 'NAD'
631
+ },
632
+ NGN: {
633
+ name: 'Nigerian Naira',
634
+ symbol: '₦',
635
+ decimals: 2,
636
+ code: 'NGN'
637
+ },
638
+ NIO: {
639
+ name: 'Nicaraguan Córdoba',
640
+ symbol: 'C$',
641
+ decimals: 2,
642
+ code: 'NIO'
643
+ },
644
+ NOK: {
645
+ name: 'Norwegian Krone',
646
+ symbol: 'kr',
647
+ decimals: 2,
648
+ code: 'NOK'
649
+ },
650
+ NPR: {
651
+ name: 'Nepalese Rupee',
652
+ symbol: 'नेरू',
653
+ decimals: 2,
654
+ code: 'NPR'
655
+ },
656
+ NZD: {
657
+ name: 'New Zealand Dollar',
658
+ symbol: '$',
659
+ decimals: 2,
660
+ code: 'NZD'
661
+ },
662
+ OMR: {
663
+ name: 'Omani Rial',
664
+ symbol: 'ر.ع.‏',
665
+ decimals: 3,
666
+ code: 'OMR'
667
+ },
668
+ PAB: {
669
+ name: 'Panamanian Balboa',
670
+ symbol: 'B/.',
671
+ decimals: 2,
672
+ code: 'PAB'
673
+ },
674
+ PEN: {
675
+ name: 'Peruvian Sol',
676
+ symbol: 'S/',
677
+ decimals: 2,
678
+ code: 'PEN'
679
+ },
680
+ PGK: {
681
+ name: 'Papua New Guinean Kina',
682
+ decimals: 2,
683
+ code: 'PGK',
684
+ symbol: 'K'
685
+ },
686
+ PHP: {
687
+ name: 'Philippine Peso',
688
+ symbol: '₱',
689
+ decimals: 2,
690
+ code: 'PHP'
691
+ },
692
+ PKR: {
693
+ name: 'Pakistani Rupee',
694
+ symbol: '₨',
695
+ decimals: 2,
696
+ code: 'PKR'
697
+ },
698
+ PLN: {
699
+ name: 'Polish Złoty',
700
+ symbol: 'zł',
701
+ decimals: 2,
702
+ code: 'PLN'
703
+ },
704
+ PYG: {
705
+ name: 'Paraguayan Guaraní',
706
+ symbol: '₲',
707
+ decimals: 0,
708
+ code: 'PYG'
709
+ },
710
+ QAR: {
711
+ name: 'Qatari Riyal',
712
+ symbol: 'ر.ق.‏',
713
+ decimals: 2,
714
+ code: 'QAR'
715
+ },
716
+ RON: {
717
+ name: 'Romanian Leu',
718
+ symbol: 'RON',
719
+ decimals: 2,
720
+ code: 'RON'
721
+ },
722
+ RSD: {
723
+ name: 'Serbian Dinar',
724
+ symbol: 'дин.',
725
+ decimals: 2,
726
+ code: 'RSD'
727
+ },
728
+ RUB: {
729
+ name: 'Russian Ruble',
730
+ symbol: 'руб.',
731
+ decimals: 2,
732
+ code: 'RUB'
733
+ },
734
+ RWF: {
735
+ name: 'Rwandan Franc',
736
+ symbol: 'FR',
737
+ decimals: 0,
738
+ code: 'RWF'
739
+ },
740
+ SAR: {
741
+ name: 'Saudi Riyal',
742
+ symbol: 'ر.س.‏',
743
+ decimals: 2,
744
+ code: 'SAR'
745
+ },
746
+ SBD: {
747
+ name: 'Solomon Islands Dollar',
748
+ decimals: 2,
749
+ code: 'SBD',
750
+ symbol: '$'
751
+ },
752
+ SCR: {
753
+ name: 'Seychellois Rupee',
754
+ decimals: 2,
755
+ code: 'SCR',
756
+ symbol: '₨'
757
+ },
758
+ SEK: {
759
+ name: 'Swedish Krona',
760
+ symbol: 'kr',
761
+ decimals: 2,
762
+ code: 'SEK'
763
+ },
764
+ SGD: {
765
+ name: 'Singapore Dollar',
766
+ symbol: '$',
767
+ decimals: 2,
768
+ code: 'SGD'
769
+ },
770
+ SHP: {
771
+ name: 'Saint Helenian Pound',
772
+ decimals: 2,
773
+ code: 'SHP',
774
+ symbol: '£'
775
+ },
776
+ SLL: {
777
+ name: 'Sierra Leonean Leone',
778
+ decimals: 2,
779
+ code: 'SLL',
780
+ symbol: 'Le'
781
+ },
782
+ SOS: {
783
+ name: 'Somali Shilling',
784
+ symbol: 'Ssh',
785
+ decimals: 2,
786
+ code: 'SOS'
787
+ },
788
+ SRD: {
789
+ name: 'Surinamese Dollar',
790
+ decimals: 2,
791
+ code: 'SRD',
792
+ symbol: '$'
793
+ },
794
+ SSP: {
795
+ name: 'South Sudanese Pound',
796
+ decimals: 2,
797
+ code: 'SSP',
798
+ symbol: '£'
799
+ },
800
+ STD: {
801
+ name: 'São Tomé and Príncipe Dobra',
802
+ decimals: 2,
803
+ code: 'STD',
804
+ symbol: 'Db'
805
+ },
806
+ SVC: {
807
+ name: 'Salvadoran Colón',
808
+ decimals: 2,
809
+ code: 'SVC',
810
+ symbol: '₡'
811
+ },
812
+ SZL: {
813
+ name: 'Swazi Lilangeni',
814
+ decimals: 2,
815
+ code: 'SZL',
816
+ symbol: 'L'
817
+ },
818
+ THB: {
819
+ name: 'Thai Baht',
820
+ symbol: '฿',
821
+ decimals: 2,
822
+ code: 'THB'
823
+ },
824
+ TJS: {
825
+ name: 'Tajikistani Somoni',
826
+ decimals: 2,
827
+ code: 'TJS',
828
+ symbol: 'ЅМ'
829
+ },
830
+ TMT: {
831
+ name: 'Turkmenistani Manat',
832
+ decimals: 2,
833
+ code: 'TMT',
834
+ symbol: 'm'
835
+ },
836
+ TND: {
837
+ name: 'Tunisian Dinar',
838
+ symbol: 'د.ت.‏',
839
+ decimals: 3,
840
+ code: 'TND'
841
+ },
842
+ TOP: {
843
+ name: 'Tongan Paʻanga',
844
+ symbol: 'T$',
845
+ decimals: 2,
846
+ code: 'TOP'
847
+ },
848
+ TRY: {
849
+ name: 'Turkish Lira',
850
+ symbol: 'TL',
851
+ decimals: 2,
852
+ code: 'TRY'
853
+ },
854
+ TTD: {
855
+ name: 'Trinidad and Tobago Dollar',
856
+ symbol: '$',
857
+ decimals: 2,
858
+ code: 'TTD'
859
+ },
860
+ TWD: {
861
+ name: 'New Taiwan Dollar',
862
+ symbol: '$',
863
+ decimals: 2,
864
+ code: 'TWD'
865
+ },
866
+ TZS: {
867
+ name: 'Tanzanian Shilling',
868
+ symbol: 'TSh',
869
+ decimals: 2,
870
+ code: 'TZS'
871
+ },
872
+ UAH: {
873
+ name: 'Ukrainian Hryvnia',
874
+ symbol: '₴',
875
+ decimals: 2,
876
+ code: 'UAH'
877
+ },
878
+ UGX: {
879
+ name: 'Ugandan Shilling',
880
+ symbol: 'USh',
881
+ decimals: 0,
882
+ code: 'UGX'
883
+ },
884
+ USD: {
885
+ name: 'United States Dollar',
886
+ symbol: '$',
887
+ decimals: 2,
888
+ code: 'USD'
889
+ },
890
+ UYU: {
891
+ name: 'Uruguayan Peso',
892
+ symbol: '$',
893
+ decimals: 2,
894
+ code: 'UYU'
895
+ },
896
+ UZS: {
897
+ name: 'Uzbekistan Som',
898
+ symbol: 'UZS',
899
+ decimals: 2,
900
+ code: 'UZS'
901
+ },
902
+ VEF: {
903
+ name: 'Venezuelan Bolívar',
904
+ symbol: 'Bs.',
905
+ decimals: 2,
906
+ code: 'VEF'
907
+ },
908
+ VND: {
909
+ name: 'Vietnamese Đồng',
910
+ symbol: '₫',
911
+ decimals: 0,
912
+ code: 'VND'
913
+ },
914
+ VUV: {
915
+ name: 'Vanuatu Vatu',
916
+ symbol: 'VT',
917
+ decimals: 0,
918
+ code: 'VUV'
919
+ },
920
+ WST: {
921
+ name: 'Samoan Tala',
922
+ symbol: '$',
923
+ decimals: 2,
924
+ code: 'WST'
925
+ },
926
+ XAF: {
927
+ name: 'Central African Cfa Franc',
928
+ symbol: 'FCFA',
929
+ decimals: 0,
930
+ code: 'XAF'
931
+ },
932
+ XAG: {
933
+ name: 'Silver (Troy Ounce)',
934
+ decimals: 0,
935
+ code: 'XAG',
936
+ symbol: 'oz'
937
+ },
938
+ XAU: {
939
+ name: 'Gold (Troy Ounce)',
940
+ symbol: 'oz',
941
+ decimals: 0,
942
+ code: 'XAU'
943
+ },
944
+ XCD: {
945
+ name: 'East Caribbean Dollar',
946
+ decimals: 2,
947
+ code: 'XCD',
948
+ symbol: '$'
949
+ },
950
+ XDR: {
951
+ name: 'Special Drawing Rights',
952
+ decimals: 0,
953
+ code: 'XDR',
954
+ symbol: 'SDR'
955
+ },
956
+ XOF: {
957
+ name: 'West African Cfa Franc',
958
+ symbol: 'CFA',
959
+ decimals: 0,
960
+ code: 'XOF'
961
+ },
962
+ XPD: {
963
+ name: 'Palladium',
964
+ decimals: 0,
965
+ code: 'XPD',
966
+ symbol: 'Pd'
967
+ },
968
+ XPF: {
969
+ name: 'Cfp Franc',
970
+ decimals: 0,
971
+ code: 'XPF',
972
+ symbol: '₣'
973
+ },
974
+ XPT: {
975
+ name: 'Platinum',
976
+ decimals: 0,
977
+ code: 'XPT',
978
+ symbol: 'Pt'
979
+ },
980
+ YER: {
981
+ name: 'Yemeni Rial',
982
+ symbol: 'ر.ي.‏',
983
+ decimals: 2,
984
+ code: 'YER'
985
+ },
986
+ ZAR: {
987
+ name: 'South African Rand',
988
+ symbol: 'R',
989
+ decimals: 2,
990
+ code: 'ZAR'
991
+ },
992
+ ZMK: {
993
+ name: 'Zambian Kwacha',
994
+ symbol: 'ZK',
995
+ decimals: 2,
996
+ code: 'ZMK'
997
+ },
998
+ ZMW: {
999
+ name: 'Zambian Kwacha',
1000
+ decimals: 2,
1001
+ code: 'ZMW',
1002
+ symbol: 'ZK'
1003
+ },
1004
+ ZWL: {
1005
+ name: 'Zimbabwean Dollar',
1006
+ decimals: 2,
1007
+ code: 'ZWL',
1008
+ symbol: '$'
1009
+ }
1010
+ }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import FontAwesome from 'react-native-vector-icons/FontAwesome';
3
3
  import { CODES } from 'ordering-components/native';
4
+ import { CURRENCY } from '../config/currency'
4
5
 
5
6
  export const flatArray = (arr: any) => [].concat(...arr);
6
7
 
@@ -158,11 +159,11 @@ export const findExitingCode = (countryCode: string) => {
158
159
  * @param {*} parser function fallback when is decimal
159
160
  * @returns string
160
161
  */
161
- export const verifyDecimals = (value: number, parser: any) => {
162
+ export const verifyDecimals = (value: number, parser: any, options?: any) => {
162
163
  if (value % 1 === 0) {
163
164
  return value;
164
165
  } else {
165
- return parser(value);
166
+ return options ? parser(value, options) : parser(value);
166
167
  }
167
168
  };
168
169
 
@@ -420,3 +421,8 @@ export const calculateDistance = (
420
421
  const distanceInKm = distance / 1000;
421
422
  return distanceInKm;
422
423
  };
424
+
425
+ export const getCurrenySymbol = (code : string) => {
426
+ return CURRENCY?.[code]?.symbol ?? code
427
+ }
428
+
@@ -690,7 +690,7 @@ const AddressFormUI = (props: AddressFormParams) => {
690
690
  )}
691
691
 
692
692
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
693
- {((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
693
+ {showField?.('internal_number') && ((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
694
694
  <Controller
695
695
  control={control}
696
696
  name="internal_number"
@@ -737,7 +737,7 @@ const AddressFormUI = (props: AddressFormParams) => {
737
737
  />
738
738
  )}
739
739
 
740
- {((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
740
+ {showField?.('zipcode') && ((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
741
741
  <Controller
742
742
  control={control}
743
743
  name="zipcode"
@@ -782,7 +782,7 @@ const AddressFormUI = (props: AddressFormParams) => {
782
782
  )}
783
783
  </View>
784
784
 
785
- {((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
785
+ {showField?.('address_notes') && ((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
786
786
  <Controller
787
787
  control={control}
788
788
  name="address_notes"