ordering-ui-react-native 0.15.78-release → 0.15.79-release

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.15.78-release",
3
+ "version": "0.15.79-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -364,6 +364,7 @@ export const OrderContentComponent = (props: OrderContent) => {
364
364
  <ProductItemAccordion
365
365
  key={product?.id || i}
366
366
  product={product}
367
+ currency={order?.currency}
367
368
  />
368
369
  ))}
369
370
  </OrderProducts>
@@ -372,7 +373,7 @@ export const OrderContentComponent = (props: OrderContent) => {
372
373
  <Table>
373
374
  <OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
374
375
  <OText mBottom={4}>
375
- {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
376
+ {parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency})}
376
377
  </OText>
377
378
  </Table>
378
379
  {(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
@@ -385,7 +386,7 @@ export const OrderContentComponent = (props: OrderContent) => {
385
386
  ) : (
386
387
  <OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
387
388
  )}
388
- <OText>- {parsePrice(order?.summary?.discount ?? order?.discount)}</OText>
389
+ <OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency})}</OText>
389
390
  </Table>
390
391
  )}
391
392
  {
@@ -399,7 +400,7 @@ export const OrderContentComponent = (props: OrderContent) => {
399
400
  )}
400
401
  </OText>
401
402
  </OSRow>
402
- <OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
403
+ <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
403
404
  </Table>
404
405
  ))
405
406
  }
@@ -407,9 +408,9 @@ export const OrderContentComponent = (props: OrderContent) => {
407
408
  <Table>
408
409
  <OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
409
410
  {order?.tax_type === 1 ? (
410
- <OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
411
+ <OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency})}</OText>
411
412
  ) : (
412
- <OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
413
+ <OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency})}</OText>
413
414
  )}
414
415
  </Table>
415
416
  )}
@@ -419,7 +420,7 @@ export const OrderContentComponent = (props: OrderContent) => {
419
420
  {t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
420
421
  </OText>
421
422
  <OText mBottom={4}>
422
- {parsePrice(order?.summary?.tax ?? 0)}
423
+ {parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency})}
423
424
  </OText>
424
425
  </Table>
425
426
  )}
@@ -430,7 +431,7 @@ export const OrderContentComponent = (props: OrderContent) => {
430
431
  {t('SERVICE_FEE', 'Service fee')}
431
432
  {`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
432
433
  </OText>
433
- <OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0)}</OText>
434
+ <OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency})}</OText>
434
435
  </Table>
435
436
  )
436
437
  }
@@ -443,7 +444,7 @@ export const OrderContentComponent = (props: OrderContent) => {
443
444
  {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
444
445
  </OText>
445
446
  </OSRow>
446
- <OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
447
+ <OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency})}</OText>
447
448
  </Table>
448
449
  ))
449
450
  }
@@ -453,10 +454,10 @@ export const OrderContentComponent = (props: OrderContent) => {
453
454
  <OSRow>
454
455
  <OText mBottom={4}>
455
456
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
456
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
457
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency})} + `}{fee.percentage}%){' '}
457
458
  </OText>
458
459
  </OSRow>
459
- <OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
460
+ <OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency})}</OText>
460
461
  </Table>
461
462
  ))
462
463
  }
@@ -471,7 +472,7 @@ export const OrderContentComponent = (props: OrderContent) => {
471
472
  )}
472
473
  </OText>
473
474
  </OSRow>
474
- <OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
475
+ <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
475
476
  </Table>
476
477
  ))
477
478
  }
@@ -483,7 +484,7 @@ export const OrderContentComponent = (props: OrderContent) => {
483
484
  </OText>
484
485
 
485
486
  <OText mBottom={4}>
486
- {parsePrice(order?.summary?.delivery_price)}
487
+ {parsePrice(order?.summary?.delivery_price, { currency: order?.currency})}
487
488
  </OText>
488
489
  </Table>
489
490
  )
@@ -499,7 +500,7 @@ export const OrderContentComponent = (props: OrderContent) => {
499
500
  )}
500
501
  </OText>
501
502
  </OSRow>
502
- <OText mBottom={4}>- {parsePrice(offer?.summary?.discount)}</OText>
503
+ <OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
503
504
  </Table>
504
505
  ))
505
506
  }
@@ -514,7 +515,7 @@ export const OrderContentComponent = (props: OrderContent) => {
514
515
  `(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
515
516
  )}
516
517
  </OText>
517
- <OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
518
+ <OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency})}</OText>
518
519
  </Table>
519
520
  )}
520
521
 
@@ -528,7 +529,7 @@ export const OrderContentComponent = (props: OrderContent) => {
528
529
  mBottom={4}
529
530
  style={styles.textBold}
530
531
  color={theme.colors.primary}>
531
- {parsePrice(order?.summary?.total ?? order?.total)}
532
+ {parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency})}
532
533
  </OText>
533
534
  </Table>
534
535
  </Total>
@@ -571,7 +572,7 @@ export const OrderContentComponent = (props: OrderContent) => {
571
572
  )}
572
573
  </View>
573
574
  <OText>
574
- -{parsePrice(event.amount)}
575
+ -{parsePrice(event.amount, { currency: order?.currency})}
575
576
  </OText>
576
577
  </View>
577
578
  ))}
@@ -28,6 +28,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
28
28
  getProductMax,
29
29
  onDeleteProduct,
30
30
  onEditProduct,
31
+ currency
31
32
  } = props;
32
33
 
33
34
  const [, t] = useLanguage();
@@ -147,7 +148,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
147
148
  }}>
148
149
  <View style={{ flexDirection: 'row' }}>
149
150
  <OText size={12} color={theme.colors.textGray}>
150
- {parsePrice(getProductPrice(product))}
151
+ {parsePrice(getProductPrice(product), { currency })}
151
152
  </OText>
152
153
 
153
154
  {(
@@ -268,7 +269,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
268
269
  suboption.position,
269
270
  )
270
271
  : '',
271
- price: parsePrice(suboption.price),
272
+ price: parsePrice(suboption.price, { currency }),
272
273
  })}
273
274
  </OText>
274
275
  </ProductSubOption>
@@ -393,6 +393,7 @@ export interface ProductItemAccordionParams {
393
393
  offsetDisabled?: any;
394
394
  isFromCheckout?: any;
395
395
  isClickableEvent?: any;
396
+ currency?: any;
396
397
  }
397
398
  export interface ReviewOrderParams {
398
399
  order?: { orderId: number; businessId: number; logo: string };