ordering-ui-react-native 0.16.94 → 0.16.95-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 (210) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +11 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +1 -1
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/OrderCreating/index.tsx +1 -21
  9. package/src/components/OrdersOption/index.tsx +54 -56
  10. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  11. package/src/components/SingleProductReview/index.tsx +7 -4
  12. package/src/components/VerifyPhone/styles.tsx +1 -2
  13. package/src/components/shared/OToast.tsx +4 -4
  14. package/src/utils/index.tsx +7 -1
  15. package/themes/business/index.tsx +2 -0
  16. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  17. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  18. package/themes/business/src/components/BusinessController/index.tsx +2 -3
  19. package/themes/business/src/components/Chat/index.tsx +146 -135
  20. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  21. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  22. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  23. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  24. package/themes/business/src/components/LoginForm/index.tsx +239 -80
  25. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  26. package/themes/business/src/components/MapView/index.tsx +18 -7
  27. package/themes/business/src/components/NewOrderNotification/index.tsx +33 -43
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  33. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  34. package/themes/business/src/components/OrdersOption/index.tsx +33 -75
  35. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +1 -1
  36. package/themes/business/src/components/PreviousMessages/index.tsx +16 -18
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  38. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  39. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  41. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +42 -25
  43. package/themes/business/src/components/StoresList/index.tsx +2 -2
  44. package/themes/business/src/components/shared/OLink.tsx +33 -13
  45. package/themes/business/src/components/shared/OModal.tsx +16 -9
  46. package/themes/business/src/components/shared/OText.tsx +8 -2
  47. package/themes/business/src/types/index.tsx +33 -2
  48. package/themes/business/src/utils/index.tsx +53 -0
  49. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  51. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  53. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  54. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  55. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  56. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  57. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  58. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  59. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  60. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  61. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  62. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  63. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  64. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  65. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  66. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  67. package/themes/kiosk/src/types/index.d.ts +13 -0
  68. package/themes/kiosk/src/utils/index.tsx +15 -0
  69. package/themes/original/index.tsx +8 -0
  70. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  71. package/themes/original/src/components/AddressForm/index.tsx +152 -116
  72. package/themes/original/src/components/AddressList/index.tsx +26 -21
  73. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  74. package/themes/original/src/components/AnalyticsSegment/index.tsx +164 -8
  75. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
  77. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
  78. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  79. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  80. package/themes/original/src/components/BusinessFeaturedController/index.tsx +4 -2
  81. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  82. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  83. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -5
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
  85. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  86. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  87. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  88. package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
  89. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  90. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  91. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
  92. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -78
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  95. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  96. package/themes/original/src/components/Cart/index.tsx +93 -43
  97. package/themes/original/src/components/CartContent/index.tsx +77 -15
  98. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  99. package/themes/original/src/components/Checkout/index.tsx +294 -175
  100. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  101. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  102. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  103. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  104. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  105. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  106. package/themes/original/src/components/Favorite/index.tsx +7 -4
  107. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  108. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  109. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  110. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  111. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  112. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  113. package/themes/original/src/components/Help/index.tsx +8 -8
  114. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  115. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  116. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  117. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  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/LanguageSelector/index.tsx +19 -14
  122. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  124. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  125. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  126. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  127. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  128. package/themes/original/src/components/Messages/index.tsx +32 -10
  129. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  130. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  131. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +117 -96
  132. package/themes/original/src/components/MultiCheckout/index.tsx +233 -83
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  137. package/themes/original/src/components/NavBar/index.tsx +6 -11
  138. package/themes/original/src/components/NotFoundSource/index.tsx +1 -1
  139. package/themes/original/src/components/Notifications/index.tsx +144 -0
  140. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  141. package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
  142. package/themes/original/src/components/OrderDetails/index.tsx +110 -221
  143. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  144. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  145. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  146. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  147. package/themes/original/src/components/OrderSummary/index.tsx +52 -17
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
  149. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  150. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  151. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  152. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  153. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  154. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  155. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  156. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  157. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  158. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  159. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  160. package/themes/original/src/components/ProductForm/index.tsx +247 -269
  161. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  162. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  163. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  164. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  165. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  166. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  167. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  168. package/themes/original/src/components/Promotions/index.tsx +234 -220
  169. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  170. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  171. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  172. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  173. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  174. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  175. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  176. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  177. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  178. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  179. package/themes/original/src/components/Sessions/index.tsx +11 -8
  180. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  181. package/themes/original/src/components/SignupForm/index.tsx +79 -66
  182. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  183. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  184. package/themes/original/src/components/SingleProductCard/index.tsx +111 -49
  185. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  186. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  187. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  188. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  189. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  190. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
  191. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  192. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  193. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  194. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  195. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  196. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  197. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  198. package/themes/original/src/components/Wallets/index.tsx +20 -19
  199. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  200. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  201. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  202. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  203. package/themes/original/src/components/shared/OButton.tsx +6 -2
  204. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  205. package/themes/original/src/components/shared/OInput.tsx +10 -1
  206. package/themes/original/src/components/shared/OModal.tsx +3 -3
  207. package/themes/original/src/layouts/Container.tsx +13 -9
  208. package/themes/original/src/types/index.tsx +45 -7
  209. package/themes/original/src/utils/index.tsx +359 -58
  210. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,11 +1,20 @@
1
1
  import React from 'react';
2
2
  import { useLanguage } from 'ordering-components/native';
3
3
  import FontAwesome from 'react-native-vector-icons/FontAwesome';
4
- import {CODES} from 'ordering-components/native'
4
+ import { CODES } from 'ordering-components/native'
5
5
  import { ORDER_TYPES } from '../config/constants';
6
+ import { useTheme } from 'styled-components/native';
7
+
8
+ const [languageState, t] = useLanguage();
9
+ const theme = useTheme()
6
10
 
7
11
  export const flatArray = (arr: any) => [].concat(...arr)
8
12
 
13
+ /**
14
+ * List of order type
15
+ */
16
+ export const orderTypeList = ['delivery', 'pickup', 'eatin', 'curbside', 'drivethru', 'seatdelivery']
17
+
9
18
  /**
10
19
  * Function to return the traduction depending of a key 't'
11
20
  * @param {string} key for traduction
@@ -43,69 +52,113 @@ export const getTraduction = (key: string) => {
43
52
  /**
44
53
  * Change local moment variables
45
54
  */
46
- export const setLocalMoment = (moment : any, t : any) => {
55
+ export const setLocalMoment = (moment: any, t: any) => {
47
56
  moment.locale('custom', {
48
57
  months: [
49
- t('MONTH1','January'),
50
- t('MONTH2','February'),
51
- t('MONTH3','March'),
52
- t('MONTH4','April'),
53
- t('MONTH5','May'),
54
- t('MONTH6','June'),
55
- t('MONTH7','July'),
56
- t('MONTH8','August'),
57
- t('MONTH9','September'),
58
- t('MONTH10','October'),
59
- t('MONTH11','November'),
60
- t('MONTH12','December')
58
+ t('MONTH1', 'January'),
59
+ t('MONTH2', 'February'),
60
+ t('MONTH3', 'March'),
61
+ t('MONTH4', 'April'),
62
+ t('MONTH5', 'May'),
63
+ t('MONTH6', 'June'),
64
+ t('MONTH7', 'July'),
65
+ t('MONTH8', 'August'),
66
+ t('MONTH9', 'September'),
67
+ t('MONTH10', 'October'),
68
+ t('MONTH11', 'November'),
69
+ t('MONTH12', 'December')
61
70
  ],
62
71
  monthsShort: [
63
- t('MONTHSHORT1','Jan'),
64
- t('MONTHSHORT2','Feb'),
65
- t('MONTHSHORT3','Mar'),
66
- t('MONTHSHORT4','Apr'),
67
- t('MONTHSHORT5','May'),
68
- t('MONTHSHORT6','Jun'),
69
- t('MONTHSHORT7','Jul'),
70
- t('MONTHSHORT8','Aug'),
71
- t('MONTHSHORT9','Sep'),
72
- t('MONTHSHORT10','Oct'),
73
- t('MONTHSHORT11','Nov'),
74
- t('MONTHSHORT12','Dec')
72
+ t('MONTHSHORT1', 'Jan'),
73
+ t('MONTHSHORT2', 'Feb'),
74
+ t('MONTHSHORT3', 'Mar'),
75
+ t('MONTHSHORT4', 'Apr'),
76
+ t('MONTHSHORT5', 'May'),
77
+ t('MONTHSHORT6', 'Jun'),
78
+ t('MONTHSHORT7', 'Jul'),
79
+ t('MONTHSHORT8', 'Aug'),
80
+ t('MONTHSHORT9', 'Sep'),
81
+ t('MONTHSHORT10', 'Oct'),
82
+ t('MONTHSHORT11', 'Nov'),
83
+ t('MONTHSHORT12', 'Dec')
75
84
  ],
76
85
  weekdays: [
77
- t('DAY7','Sunday'),
78
- t('DAY1','Monday'),
79
- t('DAY2','Tuesday'),
80
- t('DAY3','Wednesday'),
81
- t('DAY4','Thursday'),
82
- t('DAY5','Friday'),
83
- t('DAY6','Saturday')
86
+ t('DAY7', 'Sunday'),
87
+ t('DAY1', 'Monday'),
88
+ t('DAY2', 'Tuesday'),
89
+ t('DAY3', 'Wednesday'),
90
+ t('DAY4', 'Thursday'),
91
+ t('DAY5', 'Friday'),
92
+ t('DAY6', 'Saturday')
84
93
  ],
85
94
  weekdaysShort: [
86
- t('DAYSHORT7','Sun'),
87
- t('DAYSHORT1','Mon'),
88
- t('DAYSHORT2','Tue'),
89
- t('DAYSHORT3','Wed'),
90
- t('DAYSHORT4','Thu'),
91
- t('DAYSHORT5','Fri'),
92
- t('DAYSHORT6','Sat')
95
+ t('DAYSHORT7', 'Sun'),
96
+ t('DAYSHORT1', 'Mon'),
97
+ t('DAYSHORT2', 'Tue'),
98
+ t('DAYSHORT3', 'Wed'),
99
+ t('DAYSHORT4', 'Thu'),
100
+ t('DAYSHORT5', 'Fri'),
101
+ t('DAYSHORT6', 'Sat')
93
102
  ],
94
103
  weekdaysMin: [
95
- t('DAYMIN7','Su'),
96
- t('DAYMIN1','Mo'),
97
- t('DAYMIN2','Tu'),
98
- t('DAYMIN3','We'),
99
- t('DAYMIN4','Th'),
100
- t('DAYMIN5','Fr'),
101
- t('DAYMIN6','Sa')
104
+ t('DAYMIN7', 'Su'),
105
+ t('DAYMIN1', 'Mo'),
106
+ t('DAYMIN2', 'Tu'),
107
+ t('DAYMIN3', 'We'),
108
+ t('DAYMIN4', 'Th'),
109
+ t('DAYMIN5', 'Fr'),
110
+ t('DAYMIN6', 'Sa')
102
111
  ],
103
- meridiem : function (hours : any) {
104
- return hours < 12 ? t('AM', 'AM') : t('PM','PM');
112
+ meridiem: function (hours: any) {
113
+ return hours < 12 ? t('AM', 'AM') : t('PM', 'PM');
105
114
  }
106
115
  })
107
116
  }
108
117
 
118
+ export const monthsEnum: any = {
119
+ Jan: 'MONTHSHORT1',
120
+ Feb: 'MONTHSHORT2',
121
+ Mar: 'MONTHSHORT3',
122
+ Apr: 'MONTHSHORT4',
123
+ May: 'MONTHSHORT5',
124
+ Jun: 'MONTHSHORT6',
125
+ Jul: 'MONTHSHORT7',
126
+ Aug: 'MONTHSHORT8',
127
+ Sep: 'MONTHSHORT9',
128
+ Oct: 'MONTHSHORT10',
129
+ Nov: 'MONTHSHORT11',
130
+ Dec: 'MONTHSHORT12',
131
+ }
132
+
133
+ export const locale = {
134
+ name: languageState?.language?.code?.slice(0, 2),
135
+ config: {
136
+ months: [
137
+ t('MONTH1', 'January'),
138
+ t('MONTH2', 'February'),
139
+ t('MONTH3', 'March'),
140
+ t('MONTH4', 'April'),
141
+ t('MONTH5', 'May'),
142
+ t('MONTH6', 'June'),
143
+ t('MONTH7', 'July'),
144
+ t('MONTH8', 'August'),
145
+ t('MONTH9', 'September'),
146
+ t('MONTH10', 'October'),
147
+ t('MONTH11', 'November'),
148
+ t('MONTH12', 'December')
149
+ ],
150
+ weekdaysShort: [
151
+ t('DAYSHORT7', 'Sun'),
152
+ t('DAYSHORT1', 'Mon'),
153
+ t('DAYSHORT2', 'Tue'),
154
+ t('DAYSHORT3', 'Wed'),
155
+ t('DAYSHORT4', 'Thu'),
156
+ t('DAYSHORT5', 'Fri'),
157
+ t('DAYSHORT6', 'Sat')
158
+ ],
159
+ }
160
+ };
161
+
109
162
  /**
110
163
  * Function to convert delivery time in minutes
111
164
  * @param {string} time business delivery time
@@ -182,7 +235,7 @@ export const getIconCard = (brand: string, size: number) => {
182
235
  * Function to return a static google maps image based in location
183
236
  * @param {object} param object with latitude and logitude
184
237
  */
185
- export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
238
+ export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
186
239
  return `https://maps.googleapis.com/maps/api/staticmap?size=500x190&center=${lat},${lng}&zoom=17&scale=2&maptype=roadmap&&markers=icon:https://res.cloudinary.com/ditpjbrmz/image/upload/f_auto,q_auto,w_45,q_auto:best,q_auto:best/v1564675872/marker-customer_kvxric.png%7Ccolor:white%7C${lat},${lng}&key=${apiKey}`
187
240
  }
188
241
  /**
@@ -213,8 +266,8 @@ export const sortInputFields = ({ fields, values }: any) => {
213
266
  return fieldsSorted;
214
267
  }
215
268
 
216
- export const transformCountryCode = (countryCode : number) => {
217
- const code = CODES.find((code : any) => code.phoneCode === countryCode)
269
+ export const transformCountryCode = (countryCode: number) => {
270
+ const code = CODES.find((code: any) => code.phoneCode === countryCode)
218
271
  return code?.countryCode
219
272
  }
220
273
 
@@ -224,7 +277,7 @@ export const transformCountryCode = (countryCode : number) => {
224
277
  * @param {*} parser function fallback when is decimal
225
278
  * @returns string
226
279
  */
227
- export const verifyDecimals = (value: number, parser: any) => {
280
+ export const verifyDecimals = (value: number, parser: any) => {
228
281
  if (value % 1 === 0) {
229
282
  return value
230
283
  } else {
@@ -240,7 +293,7 @@ export const getTypesText = (value: number) => {
240
293
  /**
241
294
  * List shape for ribbon
242
295
  */
243
- export const shape = {
296
+ export const shape = {
244
297
  rectangle: 'rectangle',
245
298
  rectangleRound: 'rectangle_round',
246
299
  capsuleShape: 'capsule_shape'
@@ -251,7 +304,7 @@ export const getTypesText = (value: number) => {
251
304
  * @param {number} value for transform
252
305
  *
253
306
  */
254
- export const convertToRadian = (value: number) => {
307
+ export const convertToRadian = (value: number) => {
255
308
  return value * Math.PI / 180
256
309
  }
257
310
 
@@ -273,14 +326,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
273
326
  return R * c
274
327
  }
275
328
 
276
- export const formatUrlVideo = (url : string) => {
329
+ export const formatUrlVideo = (url: string) => {
277
330
  const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
278
331
  const match = url.match(regExp)
279
332
  const id = (match && match[7].length === 11) ? match[7] : false
280
333
  return `https://www.youtube-nocookie.com/embed/${id}`
281
334
  }
282
335
 
283
- export const formatSeconds = (seconds : number) => {
336
+ export const formatSeconds = (seconds: number) => {
284
337
  // Hours, minutes and seconds
285
338
  var hrs = ~~(seconds / 3600)
286
339
  var mins = ~~((seconds % 3600) / 60)
@@ -299,10 +352,258 @@ export const formatSeconds = (seconds : number) => {
299
352
  /**
300
353
  * List of price to filter businesses
301
354
  */
302
- export const priceList = [
355
+ export const priceList = [
303
356
  { level: '1', content: '$' },
304
357
  { level: '2', content: '$$' },
305
358
  { level: '3', content: '$$$' },
306
359
  { level: '4', content: '$$$$' },
307
360
  { level: '5', content: '$$$$$' }
308
361
  ]
362
+
363
+ export const getLogisticTag = (status: any) => {
364
+ const keyList: any = {
365
+ 0: t('PENDING', 'Pending'),
366
+ 1: t('IN_PROGRESS', 'In progress'),
367
+ 2: t('IN_QUEUE', 'In queue'),
368
+ 3: t('EXPIRED', 'Expired'),
369
+ 4: t('RESOLVED', 'Resolved'),
370
+ }
371
+ return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
372
+ }
373
+
374
+ export const getOrderStatus = (s: string) => {
375
+ const status = parseInt(s);
376
+ const orderStatus = [
377
+ {
378
+ key: 0,
379
+ value: t('PENDING', 'Pending'),
380
+ slug: 'PENDING',
381
+ percentage: 0.25,
382
+ image: theme.images.order.status0,
383
+ },
384
+ {
385
+ key: 1,
386
+ value: t('COMPLETED', 'Completed'),
387
+ slug: 'COMPLETED',
388
+ percentage: 1,
389
+ image: theme.images.order.status1,
390
+ },
391
+ {
392
+ key: 2,
393
+ value: t('REJECTED', 'Rejected'),
394
+ slug: 'REJECTED',
395
+ percentage: 0,
396
+ image: theme.images.order.status2,
397
+ },
398
+ {
399
+ key: 3,
400
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
401
+ slug: 'DRIVER_IN_BUSINESS',
402
+ percentage: 0.6,
403
+ image: theme.images.order.status3,
404
+ },
405
+ {
406
+ key: 4,
407
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
408
+ slug: 'PREPARATION_COMPLETED',
409
+ percentage: 0.7,
410
+ image: theme.images.order.status4,
411
+ },
412
+ {
413
+ key: 5,
414
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
415
+ slug: 'REJECTED_BY_BUSINESS',
416
+ percentage: 0,
417
+ image: theme.images.order.status5,
418
+ },
419
+ {
420
+ key: 6,
421
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
422
+ slug: 'REJECTED_BY_DRIVER',
423
+ percentage: 0,
424
+ image: theme.images.order.status6,
425
+ },
426
+ {
427
+ key: 7,
428
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
429
+ slug: 'ACCEPTED_BY_BUSINESS',
430
+ percentage: 0.35,
431
+ image: theme.images.order.status7,
432
+ },
433
+ {
434
+ key: 8,
435
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
436
+ slug: 'ACCEPTED_BY_DRIVER',
437
+ percentage: 0.45,
438
+ image: theme.images.order.status8,
439
+ },
440
+ {
441
+ key: 9,
442
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
443
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
444
+ percentage: 0.8,
445
+ image: theme.images.order.status9,
446
+ },
447
+ {
448
+ key: 10,
449
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
450
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
451
+ percentage: 0,
452
+ image: theme.images.order.status10,
453
+ },
454
+ {
455
+ key: 11,
456
+ value: t(
457
+ 'DELIVERY_COMPLETED_BY_DRIVER',
458
+ 'Delivery completed by driver',
459
+ ),
460
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
461
+ percentage: 1,
462
+ image: theme.images.order.status11,
463
+ },
464
+ {
465
+ key: 12,
466
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
467
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
468
+ percentage: 0,
469
+ image: theme.images.order.status12,
470
+ },
471
+ {
472
+ key: 13,
473
+ value: t('PREORDER', 'PreOrder'),
474
+ slug: 'PREORDER',
475
+ percentage: 0,
476
+ image: theme.images.order.status13,
477
+ },
478
+ {
479
+ key: 14,
480
+ value: t('ORDER_NOT_READY', 'Order not ready'),
481
+ slug: 'ORDER_NOT_READY',
482
+ percentage: 0,
483
+ image: theme.images.order.status13,
484
+ },
485
+ {
486
+ key: 15,
487
+ value: t(
488
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
489
+ 'Order picked up completed by customer',
490
+ ),
491
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
492
+ percentage: 100,
493
+ image: theme.images.order.status1,
494
+ },
495
+ {
496
+ key: 16,
497
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
498
+ slug: 'CANCELLED_BY_CUSTOMER',
499
+ percentage: 0,
500
+ image: theme.images.order.status2,
501
+ },
502
+ {
503
+ key: 17,
504
+ value: t(
505
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
506
+ 'Order not picked up by customer',
507
+ ),
508
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
509
+ percentage: 0,
510
+ image: theme.images.order.status2,
511
+ },
512
+ {
513
+ key: 18,
514
+ value: t(
515
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
516
+ 'Driver almost arrived to business',
517
+ ),
518
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
519
+ percentage: 0.15,
520
+ image: theme.images.order.status3,
521
+ },
522
+ {
523
+ key: 19,
524
+ value: t(
525
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
526
+ 'Driver almost arrived to customer',
527
+ ),
528
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
529
+ percentage: 0.9,
530
+ image: theme.images.order.status11,
531
+ },
532
+ {
533
+ key: 20,
534
+ value: t(
535
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
536
+ 'Customer almost arrived to business',
537
+ ),
538
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
539
+ percentage: 90,
540
+ image: theme.images.order.status7,
541
+ },
542
+ {
543
+ key: 21,
544
+ value: t(
545
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
546
+ 'Customer arrived to business',
547
+ ),
548
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
549
+ percentage: 95,
550
+ image: theme.images.order.status7,
551
+ },
552
+ {
553
+ key: 22,
554
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
555
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
556
+ percentage: 35,
557
+ image: theme.images.order.status8
558
+ },
559
+ {
560
+ key: 23,
561
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
562
+ slug: 'ORDER_DRIVER_ON_WAY',
563
+ percentage: 45,
564
+ image: theme.images.order.status8
565
+ }
566
+ ];
567
+
568
+ const objectStatus = orderStatus.find((o) => o.key === status);
569
+
570
+ return objectStatus && objectStatus;
571
+ }
572
+
573
+ /**
574
+ * Function to get brightness of color.
575
+ */
576
+ export const lightenDarkenColor = (color: any) => {
577
+
578
+ let r, g, b, hsp
579
+ if (!color) return
580
+ if (color.match(/^rgb/)) {
581
+ // If HEX --> store the red, green, blue values in separate variables
582
+ color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)
583
+
584
+ r = color[1]
585
+ g = color[2]
586
+ b = color[3]
587
+ } else {
588
+ // If RGB --> Convert it to HEX
589
+ color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'))
590
+
591
+ r = color >> 16
592
+ g = color >> 8 & 255
593
+ b = color & 255
594
+ }
595
+
596
+ // HSP (Highly Sensitive Poo) equation
597
+ hsp = Math.sqrt(
598
+ 0.299 * (r * r) +
599
+ 0.587 * (g * g) +
600
+ 0.114 * (b * b)
601
+ )
602
+
603
+ // Using the HSP value, determine whether the color is light or dark
604
+ if (hsp > 197) {
605
+ return true //is light color
606
+ } else {
607
+ return false
608
+ }
609
+ }
@@ -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}>