ordering-ui-react-native 0.14.85 → 0.14.86-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 (134) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +34 -2
  3. package/src/assets/images/no-network.png +0 -0
  4. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  5. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Cart/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +0 -1
  9. package/src/components/Home/index.tsx +3 -5
  10. package/src/components/LanguageSelector/index.tsx +65 -97
  11. package/src/components/LanguageSelector/styles.tsx +4 -17
  12. package/src/components/Messages/index.tsx +38 -30
  13. package/src/components/MomentOption/index.tsx +3 -1
  14. package/src/components/OrderDetails/index.tsx +26 -5
  15. package/src/components/PaymentOptions/index.tsx +7 -16
  16. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  17. package/src/components/ProductForm/index.tsx +1 -1
  18. package/src/components/ProductForm/styles.tsx +1 -0
  19. package/src/components/StripeElementsForm/index.tsx +27 -48
  20. package/src/components/UserProfileForm/index.tsx +35 -1
  21. package/src/components/VerifyPhone/styles.tsx +1 -2
  22. package/src/config.json +0 -2
  23. package/src/pages/Checkout.tsx +1 -1
  24. package/src/providers/AlertProvider.tsx +4 -1
  25. package/src/theme.json +2 -1
  26. package/src/types/index.tsx +2 -9
  27. package/src/utils/index.tsx +196 -1
  28. package/themes/business/index.tsx +4 -0
  29. package/themes/business/src/components/Chat/index.tsx +32 -31
  30. package/themes/business/src/components/NetworkError/index.tsx +61 -0
  31. package/themes/business/src/components/NetworkError/styles.tsx +11 -0
  32. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  34. package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
  35. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  36. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  37. package/themes/business/src/components/OrdersOption/index.tsx +351 -59
  38. package/themes/business/src/components/OrdersOption/styles.tsx +95 -7
  39. package/themes/business/src/components/PreviousOrders/index.tsx +65 -46
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +11 -8
  42. package/themes/business/src/types/index.tsx +4 -0
  43. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  44. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  45. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  46. package/themes/kiosk/index.tsx +2 -0
  47. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  48. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  49. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  50. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  51. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  52. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  53. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  54. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  55. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  56. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  57. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  58. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
  61. package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
  62. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  63. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  64. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  66. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  67. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  68. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  69. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  70. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  71. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  72. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  73. package/themes/kiosk/src/types/index.d.ts +4 -0
  74. package/themes/original/index.tsx +26 -6
  75. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
  77. package/themes/original/src/components/BusinessController/index.tsx +3 -3
  78. package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
  79. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  80. package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
  82. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  83. package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
  84. package/themes/original/src/components/Cart/index.tsx +43 -10
  85. package/themes/original/src/components/Checkout/index.tsx +54 -17
  86. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  87. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  88. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  90. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
  91. package/themes/original/src/components/LoginForm/index.tsx +83 -68
  92. package/themes/original/src/components/Messages/index.tsx +19 -21
  93. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  94. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  95. package/themes/original/src/components/NetworkError/index.tsx +61 -0
  96. package/themes/original/src/components/NetworkError/styles.tsx +11 -0
  97. package/themes/original/src/components/OrderDetails/index.tsx +103 -124
  98. package/themes/original/src/components/OrderProgress/index.tsx +2 -3
  99. package/themes/original/src/components/OrderSummary/index.tsx +34 -1
  100. package/themes/original/src/components/OrdersOption/index.tsx +16 -40
  101. package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
  102. package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
  103. package/themes/original/src/components/PaymentOptions/index.tsx +20 -23
  104. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  105. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  106. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  107. package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
  108. package/themes/original/src/components/ProductForm/index.tsx +35 -20
  109. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  110. package/themes/original/src/components/ProductOptionSubOption/index.tsx +81 -74
  111. package/themes/original/src/components/ReviewDriver/index.tsx +315 -0
  112. package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
  113. package/themes/original/src/components/ReviewOrder/index.tsx +307 -186
  114. package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
  115. package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
  116. package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
  117. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  118. package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
  119. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
  120. package/themes/original/src/components/SingleProductReview/index.tsx +166 -0
  121. package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
  122. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  123. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  124. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  125. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  126. package/themes/original/src/components/UserProfile/index.tsx +13 -6
  127. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  128. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  129. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  130. package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
  131. package/themes/original/src/types/index.tsx +47 -10
  132. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  133. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  134. package/src/components/StripeMethodForm/index.tsx +0 -163
@@ -32,7 +32,8 @@ export const getTraduction = (key: string, t: any) => {
32
32
  ERROR_PLACE_PAY_WITH_CARD1: 'An error occurred while trying to pay by card',
33
33
  ERROR_PLACE_PAY_WITH_PAYPAL_CAPTURE: 'An error occurred while trying to pay by PayPal',
34
34
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
35
- ERROR_PRODUCT_NOT_FOUND: 'Error with the product'
35
+ ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
36
+ ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
36
37
  }
37
38
 
38
39
  return keyList[key] ? t(key, keyList[key]) : t(key)
@@ -191,3 +192,197 @@ export const transformCountryCode = (countryCode : number) => {
191
192
  const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
192
193
  return R * c
193
194
  }
195
+
196
+ /**
197
+ * function to manage review comment list
198
+ * @param {number} param0 type of reviews to return
199
+ * @returns object with reviews dictionary
200
+ */
201
+ export const reviewCommentList = (type: string) => {
202
+ const [, t] = useLanguage()
203
+
204
+ const reviews: any = {
205
+ order: {
206
+ 1: {
207
+ title: t('QUICK_COMMENT_TITLE_1', "What went wrong?"),
208
+ list: [
209
+ { key: 0, content: t('QUICK_COMMENT_1_0', "Not handled with care") },
210
+ { key: 1, content: t('QUICK_COMMENT_1_1', "Poor communication") },
211
+ { key: 2, content: t('QUICK_COMMENT_1_2', "COVID-19 issue") },
212
+ { key: 3, content: t('QUICK_COMMENT_1_3', "Didn't follow instructions") },
213
+ { key: 4, content: t('QUICK_COMMENT_1_4', "Rude") },
214
+ { key: 5, content: t('QUICK_COMMENT_1_5', "Not on-time") },
215
+ ]
216
+ },
217
+ 2: {
218
+ title: t('QUICK_COMMENT_TITLE_2', "What went wrong?"),
219
+ list: [
220
+ { key: 0, content: t('QUICK_COMMENT_2_0', "Not handled with care") },
221
+ { key: 1, content: t('QUICK_COMMENT_2_1', "Poor communication") },
222
+ { key: 2, content: t('QUICK_COMMENT_2_2', "COVID-19 issue") },
223
+ { key: 3, content: t('QUICK_COMMENT_2_3', "Didn't follow instructions") },
224
+ { key: 4, content: t('QUICK_COMMENT_2_4', "Rude") },
225
+ { key: 5, content: t('QUICK_COMMENT_2_5', "Not on-time") },
226
+ ]
227
+ },
228
+ 3: {
229
+ title: t('QUICK_COMMENT_TITLE_3', "What could have been better?"),
230
+ list: [
231
+ { key: 0, content: t('QUICK_COMMENT_3_0', "Not handled with care") },
232
+ { key: 1, content: t('QUICK_COMMENT_3_1', "Poor communication") },
233
+ { key: 2, content: t('QUICK_COMMENT_3_2', "COVID-19 issue") },
234
+ { key: 3, content: t('QUICK_COMMENT_3_3', "Didn't follow instructions") },
235
+ { key: 4, content: t('QUICK_COMMENT_3_4', "Rude") },
236
+ { key: 5, content: t('QUICK_COMMENT_3_5', "Not on-time") },
237
+ ]
238
+ },
239
+ 4: {
240
+ title: t('QUICK_COMMENT_TITLE_4', " Tell us more"),
241
+ list: [
242
+ { key: 0, content: t('QUICK_COMMENT_4_0', "Not handled with care") },
243
+ { key: 1, content: t('QUICK_COMMENT_4_1', "Poor communication") },
244
+ { key: 2, content: t('QUICK_COMMENT_4_2', "COVID-19 issue") },
245
+ { key: 3, content: t('QUICK_COMMENT_4_3', "Didn't follow instructions") },
246
+ { key: 4, content: t('QUICK_COMMENT_4_4', "Rude") },
247
+ { key: 5, content: t('QUICK_COMMENT_4_5', "Not on-time") },
248
+ ]
249
+ },
250
+ 5: {
251
+ title: t('QUICK_COMMENT_TITLE_5', "What went well?"),
252
+ list: [
253
+ { key: 0, content: t('QUICK_COMMENT_5_0', "Good communication") },
254
+ { key: 1, content: t('QUICK_COMMENT_5_1', "Followed instructions") },
255
+ { key: 2, content: t('QUICK_COMMENT_5_2', "Friendly") },
256
+ { key: 3, content: t('QUICK_COMMENT_5_3', 'Handled with care') },
257
+ { key: 4, content: t('QUICK_COMMENT_5_4', "Above and beyond") },
258
+ ]
259
+ },
260
+ },
261
+ customer: {
262
+ 1: {
263
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_1', "What went wrong?"),
264
+ list: [
265
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_1_0', "Poor communication") },
266
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_1_1', "Wrong address") },
267
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_1_2', "COVID-19 issue") },
268
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_1_3', "Didn't follow instructions") },
269
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_1_4', "Rude") },
270
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_1_5', "Not on-time") },
271
+ ]
272
+ },
273
+ 2: {
274
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_2', "What went wrong?"),
275
+ list: [
276
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_2_0', "Poor communication") },
277
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_2_1', "Wrong address") },
278
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_2_2', "COVID-19 issue") },
279
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_2_3', "Didn't follow instructions") },
280
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_2_4', "Rude") },
281
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_2_5', "Not on-time") },
282
+ ]
283
+ },
284
+ 3: {
285
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_3', "What could have been better?"),
286
+ list: [
287
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_3_0', "Poor communication") },
288
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_3_1', "Wrong address") },
289
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_3_2', "COVID-19 issue") },
290
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_3_3', "Didn't follow instructions") },
291
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_3_4', "Rude") },
292
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_3_5', "Not on-time") },
293
+ ]
294
+ },
295
+ 4: {
296
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_4', " Tell us more"),
297
+ list: [
298
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_4_0', "Poor communication") },
299
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_4_1', "Wrong address") },
300
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_4_2', "COVID-19 issue") },
301
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_4_3', "Didn't follow instructions") },
302
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_4_4', "Rude") },
303
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_4_5', "Not on-time") },
304
+ ]
305
+ },
306
+ 5: {
307
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_5', "What went well?"),
308
+ list: [
309
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_5_0', "Good communication") },
310
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_5_1', "Friendly") },
311
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_5_2', "Above and beyond") },
312
+ ]
313
+ },
314
+ },
315
+ driver: {
316
+ 1: {
317
+ title: t('DRIVER_QUICK_COMMENT_TITLE_1', "What went wrong?"),
318
+ list: [
319
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_1_0', "Not handled with care") },
320
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_1_1', "Poor communication") },
321
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_1_2', "COVID-19 issue") },
322
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_1_3', "Didn't follow instructions") },
323
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_1_4', "Rude") },
324
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_1_5', "Not on-time") },
325
+ ]
326
+ },
327
+ 2: {
328
+ title: t('DRIVER_QUICK_COMMENT_TITLE_2', "What went wrong?"),
329
+ list: [
330
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_2_0', "Not handled with care") },
331
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_2_1', "Poor communication") },
332
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_2_2', "COVID-19 issue") },
333
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_2_3', "Didn't follow instructions") },
334
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_2_4', "Rude") },
335
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_2_5', "Not on-time") },
336
+ ]
337
+ },
338
+ 3: {
339
+ title: t('DRIVER_QUICK_COMMENT_TITLE_3', "What could have been better?"),
340
+ list: [
341
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_3_0', "Not handled with care") },
342
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_3_1', "Poor communication") },
343
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_3_2', "COVID-19 issue") },
344
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_3_3', "Didn't follow instructions") },
345
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_3_4', "Rude") },
346
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_3_5', "Not on-time") },
347
+ ]
348
+ },
349
+ 4: {
350
+ title: t('DRIVER_QUICK_COMMENT_TITLE_4', " Tell us more"),
351
+ list: [
352
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_4_0', "Not handled with care") },
353
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_4_1', "Poor communication") },
354
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_4_2', "COVID-19 issue") },
355
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_4_3', "Didn't follow instructions") },
356
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_4_4', "Rude") },
357
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_4_5', "Not on-time") },
358
+ ]
359
+ },
360
+ 5: {
361
+ title: t('DRIVER_QUICK_COMMENT_TITLE_5', "What went well?"),
362
+ list: [
363
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_5_0', "Good communication") },
364
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_5_1', "Followed instructions") },
365
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_5_2', "Friendly") },
366
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_5_3', 'Handled with care') },
367
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_5_4', "Above and beyond") },
368
+ ]
369
+ },
370
+ },
371
+ product: {
372
+ like: [
373
+ { key: 0, content: t('QUICK_COMMENT_LIKE_0', "Tasty") },
374
+ { key: 1, content: t('QUICK_COMMENT_LIKE_1', "Good price") },
375
+ { key: 2, content: t('QUICK_COMMENT_LIKE_2', "Good portion size") },
376
+ { key: 3, content: t('QUICK_COMMENT_LIKE_3', "Packed well") },
377
+ ],
378
+ dislike: [
379
+ { key: 0, content: t('QUICK_COMMENT_DISLIKE_0', "Not tasty") },
380
+ { key: 1, content: t('QUICK_COMMENT_DISLIKE_1', "High price") },
381
+ { key: 2, content: t('QUICK_COMMENT_DISLIKE_2', "Bad portion size") },
382
+ { key: 3, content: t('QUICK_COMMENT_DISLIKE_3', "Not packed well") },
383
+ ]
384
+ }
385
+ }
386
+
387
+ return reviews[type]
388
+ }
@@ -10,11 +10,13 @@ import { LanguageSelector } from './src/components/LanguageSelector';
10
10
  import { LoginForm } from './src/components/LoginForm';
11
11
  import { LogoutButton } from './src/components/LogoutButton';
12
12
  import { MessagesOption } from './src/components/MessagesOption';
13
+ import { NetworkError } from './src/components/NetworkError';
13
14
  import { NotFoundSource } from './src/components/NotFoundSource';
14
15
  import { OrderMessage } from './src/components/OrderMessage';
15
16
  import { OrderDetailsBusiness } from './src/components/OrderDetails/Business';
16
17
  import { OrderDetailsDelivery } from './src/components/OrderDetails/Delivery';
17
18
  import { OrdersOption } from './src/components/OrdersOption';
19
+ import { OrdersListManager } from './src/components/OrdersListManager';
18
20
  import { OrdersOptionStatus } from './src/components/OrdersOptionStatus';
19
21
  import { OrdersOptionBusiness } from './src/components/OrdersOptionBusiness';
20
22
  import { OrdersOptionCity } from './src/components/OrdersOptionCity';
@@ -77,11 +79,13 @@ export {
77
79
  MessagesOption,
78
80
  MapView,
79
81
  NewOrderNotification,
82
+ NetworkError,
80
83
  NotFoundSource,
81
84
  OrderDetailsBusiness,
82
85
  OrderDetailsDelivery,
83
86
  OrderMessage,
84
87
  OrdersOption,
88
+ OrdersListManager,
85
89
  OrdersOptionStatus,
86
90
  OrdersOptionBusiness,
87
91
  OrdersOptionCity,
@@ -94,8 +94,8 @@ const ChatUI = (props: MessagesParams) => {
94
94
  Dimensions.get('window').width < Dimensions.get('window').height
95
95
  ? parseInt(parseFloat(String(Dimensions.get('window').width)).toFixed(0))
96
96
  : parseInt(
97
- parseFloat(String(Dimensions.get('window').height)).toFixed(0),
98
- );
97
+ parseFloat(String(Dimensions.get('window').height)).toFixed(0),
98
+ );
99
99
 
100
100
  const [orientation, setOrientation] = useState<string>(
101
101
  Dimensions.get('window').width < Dimensions.get('window').height
@@ -218,7 +218,7 @@ const ChatUI = (props: MessagesParams) => {
218
218
  paddingLeft: 12,
219
219
  paddingRight: 5,
220
220
  },
221
- editButton : {
221
+ editButton: {
222
222
  borderRadius: 50,
223
223
  backgroundColor: '#E9ECEF',
224
224
  marginRight: 10,
@@ -272,9 +272,10 @@ const ChatUI = (props: MessagesParams) => {
272
272
  launchImageLibrary(
273
273
  {
274
274
  mediaType: 'photo',
275
- maxHeight: 300,
276
- maxWidth: 300,
275
+ maxHeight: 2048,
276
+ maxWidth: 2048,
277
277
  includeBase64: true,
278
+ quality: 1
278
279
  },
279
280
  (response: any) => {
280
281
  if (response.didCancel) {
@@ -366,15 +367,18 @@ const ChatUI = (props: MessagesParams) => {
366
367
  return 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS';
367
368
  case 21:
368
369
  return 'ORDER_CUSTOMER_ARRIVED_BUSINESS';
370
+ case 22:
371
+ return 'ORDER_LOOKING_FOR_DRIVER'
372
+ case 23:
373
+ return 'ORDER_DRIVER_ON_WAY'
369
374
  default:
370
375
  return ``;
371
376
  }
372
377
  }
373
378
 
374
379
  if (attribute === 'prepared_in' || attribute === 'delivered_in') {
375
- return `${hour < 10 ? '0' + hour : hour}:${min < 10 ? '0' + min : min} ${
376
- status > 60 ? 'hours' : 'minutes'
377
- }`;
380
+ return `${hour < 10 ? '0' + hour : hour}:${min < 10 ? '0' + min : min} ${status > 60 ? 'hours' : 'minutes'
381
+ }`;
378
382
  }
379
383
  };
380
384
 
@@ -400,30 +404,27 @@ const ChatUI = (props: MessagesParams) => {
400
404
  style={{ ...styles.firstMessageText, textAlign: 'center' }}>
401
405
  {message.change?.attribute !== 'driver_id'
402
406
  ? `${t('ORDER', 'Order')} ${t(
403
- message.change.attribute.toUpperCase(),
404
- message.change.attribute,
405
- )} ${t('CHANGED_FROM', 'Changed from')} ${
406
- message.change.old !== null
407
- ? t(
408
- getStatus(
409
- parseInt(message.change.old, 10),
410
- message.change?.attribute,
411
- ),
412
- )
413
- : '0'
414
- } ${t('TO', 'to')} ${t(
407
+ message.change.attribute.toUpperCase(),
408
+ message.change.attribute,
409
+ )} ${t('CHANGED_FROM', 'Changed from')} ${message.change.old !== null
410
+ ? t(
415
411
  getStatus(
416
- parseInt(message.change.new, 10),
412
+ parseInt(message.change.old, 10),
417
413
  message.change?.attribute,
418
414
  ),
419
- )}`
415
+ )
416
+ : '0'
417
+ } ${t('TO', 'to')} ${t(
418
+ getStatus(
419
+ parseInt(message.change.new, 10),
420
+ message.change?.attribute,
421
+ ),
422
+ )}`
420
423
  : message.change.new
421
- ? `${message.driver?.name} ${
422
- message.driver?.lastname !== null ? message.driver.lastname : ''
423
- } ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${
424
- message.comment ? message.comment.length : ''
424
+ ? `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''
425
+ } ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''
425
426
  }`
426
- : `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`}
427
+ : `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`}
427
428
  </OText>
428
429
  <OText size={10} color={'#aaa'} style={{ alignSelf: 'flex-start' }}>
429
430
  {parseTime(message?.created_at, { outputFormat: 'hh:mma' })}
@@ -928,8 +929,8 @@ const ChatUI = (props: MessagesParams) => {
928
929
  borderWidth: 0,
929
930
  opacity:
930
931
  sendMessage?.loading ||
931
- (message === '' && !image) ||
932
- messages?.loading
932
+ (message === '' && !image) ||
933
+ messages?.loading
933
934
  ? 0.6
934
935
  : 1,
935
936
  borderColor: theme.colors.transparent,
@@ -1034,7 +1035,7 @@ const ChatUI = (props: MessagesParams) => {
1034
1035
  <OIcon
1035
1036
  url={optimizeImage(
1036
1037
  order?.customer?.photo ||
1037
- theme?.images?.dummies?.customerPhoto,
1038
+ theme?.images?.dummies?.customerPhoto,
1038
1039
  'h_300,c_limit',
1039
1040
  )}
1040
1041
  style={styles.avatarIcon}
@@ -1141,7 +1142,7 @@ const ChatUI = (props: MessagesParams) => {
1141
1142
  backgroundColor={theme.colors.composerView}
1142
1143
  onEnd={handleEnd}
1143
1144
  />
1144
- <TouchableOpacity
1145
+ <TouchableOpacity
1145
1146
  style={{
1146
1147
  position: 'absolute',
1147
1148
  right: 35,
@@ -0,0 +1,61 @@
1
+ import React from 'react'
2
+ import { useLanguage } from 'ordering-components/native'
3
+ import { Dimensions } from 'react-native'
4
+ import RNRestart from 'react-native-restart'
5
+ import { OText, OIcon, OButton } from '../shared'
6
+ import { useTheme } from 'styled-components/native'
7
+ import { NoNetworkParams } from '../../types'
8
+ import {
9
+ Container,
10
+ ImageContainer
11
+ } from './styles'
12
+
13
+ export const NetworkError = (props: NoNetworkParams) => {
14
+ const {
15
+ image
16
+ } = props
17
+ const theme = useTheme()
18
+ const [, t] = useLanguage()
19
+
20
+ const noNetworkImage = image || theme.images.general.noNetwork
21
+ const deviceWidth = Dimensions.get('screen').width
22
+
23
+ return (
24
+ <Container>
25
+ <OText
26
+ color={theme.colors.darkText}
27
+ size={20}
28
+ weight='700'
29
+ style={{ marginBottom: 14 }}
30
+ >
31
+ {t('MOBILE_NO_INTERNET', 'No internet connection')}
32
+ </OText>
33
+ <OText
34
+ color={theme.colors.darkText}
35
+ size={14}
36
+ >
37
+ {t('NETWORK_OFFLINE_MESSAGE', 'Your connection appears to be off-line. Try to refresh the page')}
38
+ </OText>
39
+ <ImageContainer>
40
+ <OIcon
41
+ src={noNetworkImage}
42
+ width={(deviceWidth - 80) * 0.9}
43
+ height={(deviceWidth - 80) * 0.8}
44
+ />
45
+ <OButton
46
+ text={t('REFRESH', 'Refresh')}
47
+ bgColor={theme.colors.primary}
48
+ borderColor={theme.colors.primary}
49
+ style={{
50
+ borderRadius: 8,
51
+ marginTop: 45
52
+ }}
53
+ textStyle={{
54
+ color: theme.colors.white
55
+ }}
56
+ onClick={() => RNRestart.Restart()}
57
+ />
58
+ </ImageContainer>
59
+ </Container>
60
+ )
61
+ }
@@ -0,0 +1,11 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const Container = styled.View`
4
+ flex: 1;
5
+ padding: 20px 40px;
6
+ `
7
+ export const ImageContainer = styled.View`
8
+ flex: 1;
9
+ align-items: center;
10
+ justify-content: center;
11
+ `
@@ -431,6 +431,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
431
431
  handleViewSummaryOrder={handleViewSummaryOrder}
432
432
  handleCopyClipboard={handleCopyClipboard}
433
433
  handleArrowBack={handleArrowBack}
434
+ isCustomView={props.isCustomView}
434
435
  />
435
436
  <OrderDetailsContainer
436
437
  keyboardShouldPersistTaps="handled"
@@ -30,6 +30,7 @@ interface OrderHeader {
30
30
  logisticOrderStatus?: Array<number>,
31
31
  handleViewSummaryOrder?: any;
32
32
  handleCopyClipboard?: any
33
+ isCustomView?: any
33
34
  }
34
35
 
35
36
  export const OrderHeaderComponent = (props: OrderHeader) => {
@@ -105,17 +106,17 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
105
106
 
106
107
  return (
107
108
  <>
108
- <Header>
109
- <OIconButton
110
- icon={theme.images.general.arrow_left}
111
- iconStyle={{ width: 20, height: 20 }}
112
- borderColor={theme.colors.clear}
113
- style={{ ...styles.icons, justifyContent: 'flex-end' }}
114
- onClick={() => handleArrowBack()}
115
- />
116
-
117
- {
118
- (!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
109
+ {!props.isCustomView && (
110
+ <Header>
111
+ <OIconButton
112
+ icon={theme.images.general.arrow_left}
113
+ iconStyle={{ width: 20, height: 20 }}
114
+ borderColor={theme.colors.clear}
115
+ style={{ ...styles.icons, justifyContent: 'flex-end' }}
116
+ onClick={() => handleArrowBack()}
117
+ />
118
+
119
+ {(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
119
120
  <Actions>
120
121
  {getOrderStatus(order?.status, t)?.value !==
121
122
  t('PENDING', 'Pending') && (
@@ -170,13 +171,80 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
170
171
  />
171
172
  </Actions>
172
173
  )}
173
- </Header>
174
+ </Header>
175
+ )}
174
176
  <OrderHeader>
175
- <OText size={13} style={{ marginBottom: 5 }}>
176
- {order?.delivery_datetime_utc
177
- ? parseDate(order?.delivery_datetime_utc)
178
- : parseDate(order?.delivery_datetime, { utc: false })}
179
- </OText>
177
+ {!props.isCustomView ? (
178
+ <OText size={13} style={{ marginBottom: 5 }}>
179
+ {order?.delivery_datetime_utc
180
+ ? parseDate(order?.delivery_datetime_utc)
181
+ : parseDate(order?.delivery_datetime, { utc: false })}
182
+ </OText>
183
+ ) : (
184
+ <Header style={{ alignItems: 'center' }}>
185
+ <OText size={13} style={{ marginBottom: 5 }}>
186
+ {order?.delivery_datetime_utc
187
+ ? parseDate(order?.delivery_datetime_utc)
188
+ : parseDate(order?.delivery_datetime, { utc: false })}
189
+ </OText>
190
+
191
+ {(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
192
+ <Actions>
193
+ {getOrderStatus(order?.status, t)?.value !==
194
+ t('PENDING', 'Pending') && (
195
+ <>
196
+ <OIconButton
197
+ icon={theme.images.general.copy}
198
+ iconStyle={{
199
+ width: 20,
200
+ height: 25,
201
+ top: 2,
202
+ tintColor: theme.colors.backArrow,
203
+ }}
204
+ borderColor={theme.colors.clear}
205
+ style={styles.icons}
206
+ onClick={() => handleCopyClipboard?.()}
207
+ />
208
+ <OIconButton
209
+ icon={theme.images.general.print}
210
+ iconStyle={{
211
+ width: 25,
212
+ height: 22,
213
+ tintColor: theme.colors.backArrow,
214
+ }}
215
+ borderColor={theme.colors.clear}
216
+ style={styles.icons}
217
+ onClick={() => handleViewSummaryOrder?.()}
218
+ />
219
+ </>
220
+ )}
221
+ <OIconButton
222
+ icon={theme.images.general.map}
223
+ iconStyle={{
224
+ width: 20,
225
+ height: 20,
226
+ tintColor: theme.colors.backArrow,
227
+ }}
228
+ borderColor={theme.colors.clear}
229
+ style={styles.icons}
230
+ onClick={() => handleOpenMapView()}
231
+ />
232
+
233
+ <OIconButton
234
+ icon={theme.images.general.messages}
235
+ iconStyle={{
236
+ width: 20,
237
+ height: 20,
238
+ tintColor: theme.colors.backArrow,
239
+ }}
240
+ borderColor={theme.colors.clear}
241
+ style={styles.icons}
242
+ onClick={() => handleOpenMessagesForBusiness()}
243
+ />
244
+ </Actions>
245
+ )}
246
+ </Header>
247
+ )}
180
248
 
181
249
  <OText numberOfLines={2} size={20} weight="600">
182
250
  <>