ordering-ui-react-native 0.17.71 → 0.17.72-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.
Files changed (201) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +1 -21
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +5 -0
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +28 -24
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +149 -118
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  21. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +20 -93
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  25. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  32. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  33. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  34. package/themes/business/src/components/OrdersOption/index.tsx +17 -15
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +88 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +186 -114
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  44. package/themes/business/src/components/StoresList/index.tsx +3 -4
  45. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  46. package/themes/business/src/components/shared/OLink.tsx +11 -3
  47. package/themes/business/src/components/shared/OModal.tsx +16 -9
  48. package/themes/business/src/components/shared/OText.tsx +6 -1
  49. package/themes/business/src/types/index.tsx +25 -10
  50. package/themes/business/src/utils/index.tsx +29 -2
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  56. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  57. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  58. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  59. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  60. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  61. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  62. package/themes/original/index.tsx +1 -1
  63. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  64. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  65. package/themes/original/src/components/AddressList/index.tsx +25 -24
  66. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  67. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  68. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  69. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  70. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  71. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  72. package/themes/original/src/components/BusinessController/index.tsx +80 -66
  73. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  74. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  75. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  76. package/themes/original/src/components/BusinessInformation/index.tsx +139 -85
  77. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  78. package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
  79. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  81. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  82. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  83. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  84. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  85. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -555
  86. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  87. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  90. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  91. package/themes/original/src/components/Cart/index.tsx +77 -79
  92. package/themes/original/src/components/CartContent/index.tsx +117 -20
  93. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  94. package/themes/original/src/components/Checkout/index.tsx +356 -124
  95. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  96. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  97. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  98. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  99. package/themes/original/src/components/Favorite/index.tsx +2 -6
  100. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  101. package/themes/original/src/components/FloatingButton/index.tsx +10 -13
  102. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  103. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  104. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  106. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  107. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  108. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  109. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  110. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  111. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  112. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  113. package/themes/original/src/components/Help/index.tsx +2 -2
  114. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  115. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  116. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  117. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  119. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  120. package/themes/original/src/components/Home/index.tsx +13 -4
  121. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  122. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  123. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  124. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  125. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  126. package/themes/original/src/components/Messages/index.tsx +14 -7
  127. package/themes/original/src/components/MomentOption/index.tsx +193 -90
  128. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  129. package/themes/original/src/components/MultiCart/index.tsx +41 -54
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  131. package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
  132. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +40 -29
  137. package/themes/original/src/components/NavBar/index.tsx +20 -17
  138. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  139. package/themes/original/src/components/Notifications/index.tsx +42 -52
  140. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  141. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  142. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  143. package/themes/original/src/components/OrderDetails/index.tsx +191 -363
  144. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  146. package/themes/original/src/components/OrderProgress/index.tsx +30 -56
  147. package/themes/original/src/components/OrderSummary/index.tsx +88 -59
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  150. package/themes/original/src/components/OrdersOption/index.tsx +68 -87
  151. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  152. package/themes/original/src/components/PageBanner/index.tsx +98 -38
  153. package/themes/original/src/components/PageBanner/styles.tsx +0 -10
  154. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  155. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +78 -35
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  159. package/themes/original/src/components/ProductForm/index.tsx +104 -29
  160. package/themes/original/src/components/ProductForm/styles.tsx +5 -5
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -9
  162. package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
  163. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
  164. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  165. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  166. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  167. package/themes/original/src/components/Promotions/index.tsx +2 -2
  168. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  169. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  170. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  171. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  172. package/themes/original/src/components/Sessions/index.tsx +11 -8
  173. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  174. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +102 -63
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  177. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  180. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  184. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  185. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  186. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  187. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  188. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  189. package/themes/original/src/components/UserProfileForm/index.tsx +17 -21
  190. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  191. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  192. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  193. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  194. package/themes/original/src/components/Wallets/index.tsx +66 -30
  195. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  196. package/themes/original/src/components/shared/OButton.tsx +6 -2
  197. package/themes/original/src/components/shared/OInput.tsx +6 -1
  198. package/themes/original/src/components/shared/OModal.tsx +3 -3
  199. package/themes/original/src/types/index.tsx +41 -11
  200. package/themes/original/src/utils/index.tsx +273 -1
  201. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -3,9 +3,18 @@ import { useLanguage } from 'ordering-components/native';
3
3
  import FontAwesome from 'react-native-vector-icons/FontAwesome';
4
4
  import { CODES } from 'ordering-components/native'
5
5
  import { ORDER_TYPES } from '../config/constants';
6
+ import { useTheme } from 'styled-components/native';
7
+ import ReactNativeHapticFeedback from "react-native-haptic-feedback";
6
8
 
7
- export const flatArray = (arr: any) => [].concat(...arr)
8
9
  const [languageState, t] = useLanguage();
10
+ const theme = useTheme()
11
+
12
+ export const flatArray = (arr: any) => [].concat(...arr)
13
+
14
+ /**
15
+ * List of order type
16
+ */
17
+ export const orderTypeList = ['delivery', 'pickup', 'eatin', 'curbside', 'drivethru', 'seatdelivery']
9
18
 
10
19
  /**
11
20
  * Function to return the traduction depending of a key 't'
@@ -263,6 +272,11 @@ export const transformCountryCode = (countryCode: number) => {
263
272
  return code?.countryCode
264
273
  }
265
274
 
275
+ export const findExitingCode = (countryCode: string) => {
276
+ const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
277
+ return code?.countryCode
278
+ }
279
+
266
280
  /**
267
281
  * Function to check if a number is decimal or not
268
282
  * @param {*} value number to check if decimal or not
@@ -351,3 +365,261 @@ export const priceList = [
351
365
  { level: '4', content: '$$$$' },
352
366
  { level: '5', content: '$$$$$' }
353
367
  ]
368
+
369
+ export const getLogisticTag = (status: any) => {
370
+ const keyList: any = {
371
+ 0: t('PENDING', 'Pending'),
372
+ 1: t('IN_PROGRESS', 'In progress'),
373
+ 2: t('IN_QUEUE', 'In queue'),
374
+ 3: t('EXPIRED', 'Expired'),
375
+ 4: t('RESOLVED', 'Resolved'),
376
+ }
377
+ return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
378
+ }
379
+
380
+ export const getOrderStatus = (s: string) => {
381
+ const status = parseInt(s);
382
+ const orderStatus = [
383
+ {
384
+ key: 0,
385
+ value: t('PENDING', 'Pending'),
386
+ slug: 'PENDING',
387
+ percentage: 0.1,
388
+ image: theme.images.order.status0,
389
+ },
390
+ {
391
+ key: 1,
392
+ value: t('COMPLETED', 'Completed'),
393
+ slug: 'COMPLETED',
394
+ percentage: 1,
395
+ image: theme.images.order.status1,
396
+ },
397
+ {
398
+ key: 2,
399
+ value: t('REJECTED', 'Rejected'),
400
+ slug: 'REJECTED',
401
+ percentage: 0,
402
+ image: theme.images.order.status2,
403
+ },
404
+ {
405
+ key: 3,
406
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
407
+ slug: 'DRIVER_IN_BUSINESS',
408
+ percentage: 0.6,
409
+ image: theme.images.order.status3,
410
+ },
411
+ {
412
+ key: 4,
413
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
414
+ slug: 'PREPARATION_COMPLETED',
415
+ percentage: 0.2,
416
+ image: theme.images.order.status4,
417
+ },
418
+ {
419
+ key: 5,
420
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
421
+ slug: 'REJECTED_BY_BUSINESS',
422
+ percentage: 0,
423
+ image: theme.images.order.status5,
424
+ },
425
+ {
426
+ key: 6,
427
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
428
+ slug: 'REJECTED_BY_DRIVER',
429
+ percentage: 0,
430
+ image: theme.images.order.status6,
431
+ },
432
+ {
433
+ key: 7,
434
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
435
+ slug: 'ACCEPTED_BY_BUSINESS',
436
+ percentage: 0.15,
437
+ image: theme.images.order.status7,
438
+ },
439
+ {
440
+ key: 8,
441
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
442
+ slug: 'ACCEPTED_BY_DRIVER',
443
+ percentage: 0.4,
444
+ image: theme.images.order.status8,
445
+ },
446
+ {
447
+ key: 9,
448
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
449
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
450
+ percentage: 0.7,
451
+ image: theme.images.order.status9,
452
+ },
453
+ {
454
+ key: 10,
455
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
456
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
457
+ percentage: 0,
458
+ image: theme.images.order.status10,
459
+ },
460
+ {
461
+ key: 11,
462
+ value: t(
463
+ 'DELIVERY_COMPLETED_BY_DRIVER',
464
+ 'Delivery completed by driver',
465
+ ),
466
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
467
+ percentage: 1,
468
+ image: theme.images.order.status11,
469
+ },
470
+ {
471
+ key: 12,
472
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
473
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
474
+ percentage: 0,
475
+ image: theme.images.order.status12,
476
+ },
477
+ {
478
+ key: 13,
479
+ value: t('PREORDER', 'PreOrder'),
480
+ slug: 'PREORDER',
481
+ percentage: 0,
482
+ image: theme.images.order.status13,
483
+ },
484
+ {
485
+ key: 14,
486
+ value: t('ORDER_NOT_READY', 'Order not ready'),
487
+ slug: 'ORDER_NOT_READY',
488
+ percentage: 0.15,
489
+ image: theme.images.order.status13,
490
+ },
491
+ {
492
+ key: 15,
493
+ value: t(
494
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
495
+ 'Order picked up completed by customer',
496
+ ),
497
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
498
+ percentage: 1,
499
+ image: theme.images.order.status1,
500
+ },
501
+ {
502
+ key: 16,
503
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
504
+ slug: 'CANCELLED_BY_CUSTOMER',
505
+ percentage: 0,
506
+ image: theme.images.order.status2,
507
+ },
508
+ {
509
+ key: 17,
510
+ value: t(
511
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
512
+ 'Order not picked up by customer',
513
+ ),
514
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
515
+ percentage: 0,
516
+ image: theme.images.order.status2,
517
+ },
518
+ {
519
+ key: 18,
520
+ value: t(
521
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
522
+ 'Driver almost arrived to business',
523
+ ),
524
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
525
+ percentage: 0.5,
526
+ image: theme.images.order.status3,
527
+ },
528
+ {
529
+ key: 19,
530
+ value: t(
531
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
532
+ 'Driver almost arrived to customer',
533
+ ),
534
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
535
+ percentage: 0.9,
536
+ image: theme.images.order.status11,
537
+ },
538
+ {
539
+ key: 20,
540
+ value: t(
541
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
542
+ 'Customer almost arrived to business',
543
+ ),
544
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
545
+ percentage: 0.9,
546
+ image: theme.images.order.status7,
547
+ },
548
+ {
549
+ key: 21,
550
+ value: t(
551
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
552
+ 'Customer arrived to business',
553
+ ),
554
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
555
+ percentage: 0.9,
556
+ image: theme.images.order.status7,
557
+ },
558
+ {
559
+ key: 22,
560
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
561
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
562
+ percentage: 0.3,
563
+ image: theme.images.order.status8
564
+ },
565
+ {
566
+ key: 23,
567
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
568
+ slug: 'ORDER_DRIVER_ON_WAY',
569
+ percentage: 0.8,
570
+ image: theme.images.order.status8
571
+ }
572
+ ];
573
+
574
+ const objectStatus = orderStatus.find((o) => o.key === status);
575
+
576
+ return objectStatus && objectStatus;
577
+ }
578
+
579
+ /**
580
+ * Function to get brightness of color.
581
+ */
582
+ export const lightenDarkenColor = (color: any) => {
583
+
584
+ let r, g, b, hsp
585
+ if (!color) return
586
+ if (color.match(/^rgb/)) {
587
+ // If HEX --> store the red, green, blue values in separate variables
588
+ color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)
589
+
590
+ r = color[1]
591
+ g = color[2]
592
+ b = color[3]
593
+ } else {
594
+ // If RGB --> Convert it to HEX
595
+ color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'))
596
+
597
+ r = color >> 16
598
+ g = color >> 8 & 255
599
+ b = color & 255
600
+ }
601
+
602
+ // HSP (Highly Sensitive Poo) equation
603
+ hsp = Math.sqrt(
604
+ 0.299 * (r * r) +
605
+ 0.587 * (g * g) +
606
+ 0.114 * (b * b)
607
+ )
608
+
609
+ // Using the HSP value, determine whether the color is light or dark
610
+ if (hsp > 197) {
611
+ return true //is light color
612
+ } else {
613
+ return false
614
+ }
615
+ }
616
+
617
+ export const vibrateApp = (impact ?: string) => {
618
+ const options = {
619
+ enableVibrateFallback: true,
620
+ ignoreAndroidSystemSettings: false
621
+ };
622
+
623
+ ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
624
+
625
+ }
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
144
144
  {isFarAway && (
145
145
  <FarAwayMessage style={styles.farAwayMsg}>
146
146
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
147
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
147
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
148
148
  </FarAwayMessage>
149
149
  )}
150
150
  <View style={styles.wrapperOrderOptions}>