ordering-ui-react-native 0.17.76 → 0.17.77-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 (225) 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 -25
  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 +128 -96
  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 +102 -40
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +70 -67
  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 +20 -22
  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 +139 -174
  41. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  43. package/themes/business/src/components/StoresList/index.tsx +3 -4
  44. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  45. package/themes/business/src/components/shared/OLink.tsx +9 -2
  46. package/themes/business/src/components/shared/OModal.tsx +16 -9
  47. package/themes/business/src/components/shared/OText.tsx +6 -1
  48. package/themes/business/src/types/index.tsx +25 -10
  49. package/themes/business/src/utils/index.tsx +29 -2
  50. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  52. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  53. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  54. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  55. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  56. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  57. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  58. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  59. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  60. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  61. package/themes/original/index.tsx +1 -1
  62. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  63. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  64. package/themes/original/src/components/AddressList/index.tsx +11 -6
  65. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  66. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  67. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  68. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  69. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  70. package/themes/original/src/components/BusinessController/index.tsx +81 -68
  71. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  72. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  73. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  74. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  75. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  76. package/themes/original/src/components/BusinessListingSearch/index.tsx +348 -340
  77. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  78. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  79. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  80. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  81. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  82. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  83. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -559
  84. package/themes/original/src/components/BusinessProductsListing/styles.tsx +1 -1
  85. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +70 -39
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  88. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  89. package/themes/original/src/components/Cart/index.tsx +76 -79
  90. package/themes/original/src/components/CartContent/index.tsx +112 -19
  91. package/themes/original/src/components/CartContent/styles.tsx +16 -6
  92. package/themes/original/src/components/Checkout/index.tsx +294 -56
  93. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  94. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  95. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  96. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  97. package/themes/original/src/components/Favorite/index.tsx +2 -6
  98. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  99. package/themes/original/src/components/FloatingButton/index.tsx +10 -13
  100. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  101. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +7 -3
  102. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
  103. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +19 -6
  104. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  105. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  106. package/themes/original/src/components/Help/index.tsx +2 -2
  107. package/themes/original/src/components/HelpGuide/index.tsx +2 -2
  108. package/themes/original/src/components/HelpGuide/styles.tsx +1 -0
  109. package/themes/original/src/components/Home/index.tsx +13 -4
  110. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  111. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  112. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  113. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  114. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  115. package/themes/original/src/components/Messages/index.tsx +14 -7
  116. package/themes/original/src/components/MomentOption/index.tsx +193 -90
  117. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  118. package/themes/original/src/components/MultiCart/index.tsx +41 -54
  119. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
  120. package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
  121. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  122. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  123. package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
  124. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  125. package/themes/original/src/components/MyOrders/index.tsx +37 -24
  126. package/themes/original/src/components/NavBar/index.tsx +20 -12
  127. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  128. package/themes/original/src/components/Notifications/styles.tsx +1 -5
  129. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  130. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  131. package/themes/original/src/components/OrderDetails/index.tsx +139 -306
  132. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  133. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  134. package/themes/original/src/components/OrderProgress/index.tsx +33 -57
  135. package/themes/original/src/components/OrderSummary/index.tsx +83 -57
  136. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  137. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  138. package/themes/original/src/components/OrdersOption/index.tsx +61 -81
  139. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  140. package/themes/original/src/components/PageBanner/index.tsx +98 -38
  141. package/themes/original/src/components/PageBanner/styles.tsx +0 -10
  142. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  143. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  144. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  145. package/themes/original/src/components/PaymentOptions/index.tsx +95 -33
  146. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  147. package/themes/original/src/components/ProductForm/index.tsx +103 -40
  148. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  149. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
  150. package/themes/original/src/components/ProductOptionSubOption/index.tsx +50 -21
  151. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  152. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  153. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  154. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  155. package/themes/original/src/components/Promotions/index.tsx +2 -2
  156. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  157. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  158. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  159. package/themes/original/src/components/ServiceForm/index.tsx +63 -20
  160. package/themes/original/src/components/Sessions/index.tsx +11 -8
  161. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  162. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  163. package/themes/original/src/components/SingleOrderCard/index.tsx +102 -63
  164. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  165. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  166. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  167. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  168. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  169. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  170. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  171. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  172. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  173. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  174. package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
  175. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  176. package/themes/original/src/components/UserProfile/index.tsx +87 -76
  177. package/themes/original/src/components/UserProfileForm/index.tsx +10 -3
  178. package/themes/original/src/components/UserProfileForm/styles.tsx +1 -1
  179. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  180. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  181. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  182. package/themes/original/src/components/Wallets/index.tsx +56 -33
  183. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  184. package/themes/original/src/components/shared/OButton.tsx +6 -2
  185. package/themes/original/src/components/shared/OInput.tsx +6 -1
  186. package/themes/original/src/components/shared/OModal.tsx +3 -3
  187. package/themes/original/src/types/index.tsx +39 -10
  188. package/themes/original/src/utils/index.tsx +386 -1
  189. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  190. package/src/navigators/BottomNavigator.tsx +0 -117
  191. package/src/navigators/CheckoutNavigator.tsx +0 -66
  192. package/src/navigators/HomeNavigator.tsx +0 -202
  193. package/src/navigators/NavigationRef.tsx +0 -7
  194. package/src/navigators/RootNavigator.tsx +0 -269
  195. package/src/pages/Account.tsx +0 -34
  196. package/src/pages/AddressForm.tsx +0 -62
  197. package/src/pages/AddressList.tsx +0 -24
  198. package/src/pages/BusinessProductsList.tsx +0 -81
  199. package/src/pages/BusinessesListing.tsx +0 -43
  200. package/src/pages/CartList.tsx +0 -49
  201. package/src/pages/Checkout.tsx +0 -101
  202. package/src/pages/ForgotPassword.tsx +0 -24
  203. package/src/pages/Help.tsx +0 -23
  204. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  205. package/src/pages/HelpGuide.tsx +0 -23
  206. package/src/pages/HelpOrder.tsx +0 -23
  207. package/src/pages/Home.tsx +0 -36
  208. package/src/pages/IntroductoryTutorial.tsx +0 -170
  209. package/src/pages/Login.tsx +0 -47
  210. package/src/pages/MomentOption.tsx +0 -30
  211. package/src/pages/MultiCheckout.tsx +0 -31
  212. package/src/pages/MultiOrdersDetails.tsx +0 -27
  213. package/src/pages/MyOrders.tsx +0 -40
  214. package/src/pages/NetworkError.tsx +0 -24
  215. package/src/pages/NotFound.tsx +0 -22
  216. package/src/pages/OrderDetails.tsx +0 -25
  217. package/src/pages/ProductDetails.tsx +0 -55
  218. package/src/pages/Profile.tsx +0 -36
  219. package/src/pages/ReviewDriver.tsx +0 -30
  220. package/src/pages/ReviewOrder.tsx +0 -32
  221. package/src/pages/ReviewProducts.tsx +0 -30
  222. package/src/pages/Sessions.tsx +0 -22
  223. package/src/pages/Signup.tsx +0 -53
  224. package/src/pages/SpinnerLoader.tsx +0 -10
  225. package/src/pages/Splash.tsx +0 -21
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity, Vibration } from 'react-native';
2
+ import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity } from 'react-native';
3
3
  import { useForm, Controller } from 'react-hook-form';
4
4
  import Spinner from 'react-native-loading-spinner-overlay';
5
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
@@ -8,6 +8,7 @@ import { PhoneInputNumber } from '../PhoneInputNumber';
8
8
  import { FacebookLogin } from '../FacebookLogin';
9
9
  import Recaptcha from 'react-native-recaptcha-that-works'
10
10
  import ReCaptcha from '@fatnlazycat/react-native-recaptcha-v3'
11
+ import ReactNativeHapticFeedback from "react-native-haptic-feedback";
11
12
 
12
13
  import {
13
14
  SignupForm as SignUpController,
@@ -83,7 +84,8 @@ const SignupFormUI = (props: SignupParams) => {
83
84
  signUpTab,
84
85
  useSignUpFullDetails,
85
86
  useSignUpOtpEmail,
86
- useSignUpOtpCellphone
87
+ useSignUpOtpCellphone,
88
+ isGuest
87
89
  } = props;
88
90
 
89
91
  const theme = useTheme();
@@ -163,6 +165,14 @@ const SignupFormUI = (props: SignupParams) => {
163
165
  })
164
166
  }
165
167
 
168
+ const vibrateApp = (impact?: string) => {
169
+ const options = {
170
+ enableVibrateFallback: true,
171
+ ignoreAndroidSystemSettings: false
172
+ };
173
+ ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
174
+ }
175
+
166
176
  const handleRefs = (ref: any, code: string) => {
167
177
  switch (code) {
168
178
  case 'name': {
@@ -245,7 +255,7 @@ const SignupFormUI = (props: SignupParams) => {
245
255
  const onSubmit = (values?: any) => {
246
256
  if (phoneInputData.error && signUpTab !== 'otpEmail') {
247
257
  showToast(ToastType.Error, phoneInputData.error);
248
- Vibration.vibrate()
258
+ vibrateApp()
249
259
  return;
250
260
  }
251
261
  if (
@@ -263,7 +273,7 @@ const SignupFormUI = (props: SignupParams) => {
263
273
  'The field Mobile phone is required.',
264
274
  ),
265
275
  );
266
- Vibration.vibrate()
276
+ vibrateApp()
267
277
  return;
268
278
  }
269
279
  if (signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') {
@@ -322,7 +332,7 @@ const SignupFormUI = (props: SignupParams) => {
322
332
  };
323
333
 
324
334
  const handleChangeInputEmail = (value: string, onChange: any) => {
325
- onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''));
335
+ onChange(value.toLowerCase().trim().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''));
326
336
  };
327
337
 
328
338
  const handleOpenTermsUrl = async (url: any) => {
@@ -332,7 +342,7 @@ const SignupFormUI = (props: SignupParams) => {
332
342
  await Linking.openURL(url);
333
343
  } else {
334
344
  showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
335
- Vibration.vibrate()
345
+ vibrateApp()
336
346
  }
337
347
  }
338
348
 
@@ -340,12 +350,12 @@ const SignupFormUI = (props: SignupParams) => {
340
350
  setRecaptchaVerified(false)
341
351
  if (!recaptchaConfig?.siteKey) {
342
352
  showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
343
- Vibration.vibrate()
353
+ vibrateApp()
344
354
  return
345
355
  }
346
356
  if (!recaptchaConfig?.baseUrl) {
347
357
  showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
348
- Vibration.vibrate()
358
+ vibrateApp()
349
359
  return
350
360
  }
351
361
  recaptchaRef.current.open()
@@ -389,11 +399,13 @@ const SignupFormUI = (props: SignupParams) => {
389
399
  baseUrl: configs?.security_recaptcha_base_url?.value || null
390
400
  })
391
401
  showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
392
- Vibration.vibrate()
402
+ vibrateApp()
393
403
  return
394
404
  }
395
- formState.result?.result && showToast(ToastType.Error, formState.result?.result[0]);
396
- formState.result?.result && Vibration.vibrate()
405
+ formState.result?.result && formState.result?.result[0]?.includes("_") ?
406
+ showToast(ToastType.Error, t(`${formState.result?.result[0]}`, 'Phone number already used')) :
407
+ showToast(ToastType.Error, formState.result?.result[0])
408
+ formState.result?.result && vibrateApp()
397
409
  setIsLoadingVerifyModal(false);
398
410
  }
399
411
  }, [formState]);
@@ -401,7 +413,7 @@ const SignupFormUI = (props: SignupParams) => {
401
413
  useEffect(() => {
402
414
  if (Object.keys(errors).length > 0) {
403
415
  setIsLoadingVerifyModal(false);
404
- Vibration.vibrate()
416
+ vibrateApp()
405
417
  }
406
418
  }, [errors])
407
419
 
@@ -430,7 +442,7 @@ const SignupFormUI = (props: SignupParams) => {
430
442
  ? verifyPhoneState?.result?.result
431
443
  : verifyPhoneState?.result?.result[0];
432
444
  verifyPhoneState.result?.result && showToast(ToastType.Error, message);
433
- verifyPhoneState.result?.result && Vibration.vibrate()
445
+ verifyPhoneState.result?.result && vibrateApp()
434
446
  setIsLoadingVerifyModal(false);
435
447
  return;
436
448
  }
@@ -465,15 +477,19 @@ const SignupFormUI = (props: SignupParams) => {
465
477
 
466
478
  return (
467
479
  <View>
468
- <NavBar
469
- title={t('SIGNUP', 'Signup')}
470
- titleAlign={'center'}
471
- onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
472
- showCall={false}
473
- btnStyle={{ paddingLeft: 0 }}
474
- titleWrapStyle={{ paddingHorizontal: 0 }}
475
- titleStyle={{ marginLeft: 0, marginRight: 0 }}
476
- />
480
+ {isGuest ? (
481
+ <OText style={{ textAlign: 'center', marginBottom: 10 }} size={18}>{t('SIGNUP', 'Signup')}</OText>
482
+ ) : (
483
+ <NavBar
484
+ title={t('SIGNUP', 'Signup')}
485
+ titleAlign={'center'}
486
+ onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
487
+ showCall={false}
488
+ btnStyle={{ paddingLeft: 0 }}
489
+ titleWrapStyle={{ paddingHorizontal: 0 }}
490
+ titleStyle={{ marginLeft: 0, marginRight: 0 }}
491
+ />
492
+ )}
477
493
  <FormSide>
478
494
  {((Number(useSignUpFullDetails) + Number(useSignUpOtpEmail) + Number(useSignUpOtpCellphone)) > 1) && (
479
495
  <SignupWith>
@@ -586,7 +602,7 @@ const SignupFormUI = (props: SignupParams) => {
586
602
  control={control}
587
603
  render={({ onChange, value }: any) => (
588
604
  <OInput
589
- placeholder={t(field.name)}
605
+ placeholder={t(field.name?.replace(/\s/g, '_')?.toUpperCase(), field.name)}
590
606
  style={style.inputStyle}
591
607
  icon={
592
608
  field.code === 'email'
@@ -893,7 +909,7 @@ const SignupFormUI = (props: SignupParams) => {
893
909
  </View>
894
910
  )
895
911
  }
896
- {configs && Object.keys(configs).length > 0 && (
912
+ {configs && Object.keys(configs).length > 0 && !isGuest && (
897
913
  (((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
898
914
  ((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
899
915
  ((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
@@ -925,7 +941,7 @@ const SignupFormUI = (props: SignupParams) => {
925
941
  (
926
942
  <FacebookLogin
927
943
  notificationState={notificationState}
928
- handleErrors={(err: any) => { showToast(ToastType.Error, err), Vibration.vibrate() }}
944
+ handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
929
945
  handleLoading={(val: boolean) => setIsFBLoading(val)}
930
946
  handleSuccessFacebookLogin={handleSuccessFacebook}
931
947
  />
@@ -934,7 +950,7 @@ const SignupFormUI = (props: SignupParams) => {
934
950
  <GoogleLogin
935
951
  notificationState={notificationState}
936
952
  webClientId={configs?.google_login_client_id?.value}
937
- handleErrors={(err: any) => { showToast(ToastType.Error, err), Vibration.vibrate() }}
953
+ handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
938
954
  handleLoading={(val: boolean) => setIsFBLoading(val)}
939
955
  handleSuccessGoogleLogin={handleSuccessFacebook}
940
956
  />
@@ -942,7 +958,7 @@ const SignupFormUI = (props: SignupParams) => {
942
958
  {(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
943
959
  <AppleLogin
944
960
  notificationState={notificationState}
945
- handleErrors={(err: any) => { showToast(ToastType.Error, err), Vibration.vibrate() }}
961
+ handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
946
962
  handleLoading={(val: boolean) => setIsFBLoading(val)}
947
963
  handleSuccessAppleLogin={handleSuccessFacebook}
948
964
  />
@@ -1,16 +1,18 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import {
3
3
  SingleOrderCard as SingleOrderCardController,
4
4
  useUtils,
5
5
  useOrder,
6
6
  useLanguage
7
7
  } from 'ordering-components/native';
8
+ import FastImage from 'react-native-fast-image'
8
9
  import { StyleSheet, TouchableOpacity, View } from 'react-native';
9
10
  import { useTheme } from 'styled-components/native';
10
11
  import { OIcon, OText, OButton } from '../shared';
11
12
  import { SingleOrderCardParams } from '../../types';
12
13
  import { OAlert } from '../../../../../src/components/shared'
13
-
14
+ import { OrderEta } from '../OrderDetails/OrderEta'
15
+ import { useIsFocused } from '@react-navigation/native';
14
16
  import {
15
17
  InnerContainer,
16
18
  Logo,
@@ -44,12 +46,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
44
46
  const [, t] = useLanguage();
45
47
  const [{ carts }] = useOrder()
46
48
  const theme = useTheme();
49
+ const isFocused = useIsFocused();
47
50
 
48
- const [reorderSelected, setReorderSelected] = useState<number | null>(null);
51
+ let [reorderSelected, setReorderSelected] = useState<number | null>(null);
49
52
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
50
53
  const [isPressed, setIsPressed] = useState(false)
51
54
 
52
- const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12];
55
+ const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12, 15];
53
56
 
54
57
  const styles = StyleSheet.create({
55
58
  container: {
@@ -84,9 +87,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
84
87
  marginRight: 2,
85
88
  },
86
89
  reorderLoading: {
87
- width: 80,
88
- height: 40,
89
- borderRadius: 10,
90
+ height: 23,
91
+ paddingLeft: 20,
92
+ paddingRight: 20,
93
+ borderRadius: 23,
94
+ shadowOpacity: 0,
95
+ backgroundColor: theme.colors.primary,
96
+ borderWidth: 0,
90
97
  },
91
98
  reorderbutton: {
92
99
  height: 23,
@@ -124,19 +131,29 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
124
131
  });
125
132
 
126
133
  const handleReorderClick = (order: any) => {
127
- if (carts[`businessId:${order?.business_id}`] && carts[`businessId:${order?.business_id}`]?.products?.length > 0) {
134
+ setReorderSelected(null)
135
+ reorderSelected = null
136
+ const isMultiOrders = Array.isArray(order?.id)
137
+
138
+ const isRemoveCart = isMultiOrders
139
+ ? order?.business_id?.some((businessId: any) => !!carts[`businessId:${businessId}`]?.uuid)
140
+ : carts[`businessId:${order?.business_id}`] && !!carts[`businessId:${order?.business_id}`]?.uuid
141
+
142
+ if (isRemoveCart) {
128
143
  setConfirm({
129
144
  open: true,
130
145
  content: [t('QUESTION_DELETE_PRODUCTS_FROM_CART', 'Are you sure that you want to delete all products from cart?')],
131
146
  title: t('ORDER', 'Order'),
132
147
  handleOnAccept: async () => {
133
- handleRemoveCart()
148
+ handleRemoveCart(order)
134
149
  setConfirm({ ...confirm, open: false })
135
150
  }
136
151
  })
137
152
  } else {
138
- setReorderSelected(order?.id);
139
- handleReorder && handleReorder(order?.id);
153
+ const orderId = Array.isArray(order?.id) ? order?.id[0] : order?.id
154
+ setReorderSelected(orderId)
155
+ reorderSelected = orderId
156
+ handleReorder && handleReorder(order?.id)
140
157
  }
141
158
  };
142
159
 
@@ -147,7 +164,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
147
164
  order: {
148
165
  id: order?.id,
149
166
  business_id: order?.business_id,
150
- logo: order?.business?.length > 1 ? order?.business?.map?.((business : any) => business?.logo): order?.business?.logo,
167
+ logo: order?.business?.length > 1 ? order?.business?.map?.((business: any) => business?.logo) : order?.business?.logo,
151
168
  driver: order?.driver,
152
169
  products: order?.products,
153
170
  review: order?.review,
@@ -170,7 +187,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
170
187
  handleClickOrder(order?.uuid)
171
188
  return
172
189
  }
173
- if (order?.cart_group_id){
190
+ if (order?.cart_group_id) {
174
191
  onNavigationRedirect?.('MultiOrdersDetails', { orderId: order?.cart_group_id });
175
192
  } else {
176
193
  onNavigationRedirect?.('OrderDetails', { orderId: order?.uuid });
@@ -183,10 +200,21 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
183
200
 
184
201
  const handleOriginalReorder = () => {
185
202
  setConfirm({ ...confirm, open: false, title: null })
186
- setReorderSelected(order?.id);
187
- handleReorder && handleReorder(order?.id);
188
203
  }
189
204
 
205
+ const hideBusinessLogo = theme?.orders?.components?.business_logo?.hidden
206
+ const hideDate = theme?.orders?.components?.date?.hidden
207
+ const hideBusinessName = theme?.orders?.components?.business_name?.hidden
208
+ const hideOrderNumber = theme?.orders?.components?.order_number?.hidden
209
+ const hideReviewOrderButton = theme?.orders?.components?.review_order_button?.hidden
210
+ const hideReorderButton = theme?.orders?.components?.reorder_button?.hidden
211
+ const hideFavorite = theme?.orders?.components?.favorite?.hidden
212
+ const hideOrderStatus = theme?.orders?.components?.order_status?.hidden
213
+
214
+ useEffect(() => {
215
+ if (isFocused) setReorderSelected(null)
216
+ }, [isFocused])
217
+
190
218
  return (
191
219
  <>
192
220
  <CardAnimation
@@ -194,35 +222,39 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
194
222
  style={[styles.container]}
195
223
  >
196
224
  <InnerContainer>
197
- {(!!order.business?.logo || theme?.images?.dummies?.businessLogo) && (
225
+ {!hideBusinessLogo && (!!order.business?.logo || theme?.images?.dummies?.businessLogo) && (
198
226
  <>
199
227
  {order?.business?.length > 1 ? (
200
228
  <MultiLogosContainer>
201
- {order?.business?.map((business: any, i: number) => (
202
- <View key={business?.id}>
203
- {i > 1 ? (
204
- <>
205
- {console.log(order?.business?.length - 2)}
206
- <OText mRight={3}> + {order?.business?.length - 2}</OText>
207
- </>
208
- ) : (
209
- <Logo style={styles.logoWrapper} isMulti>
210
- <OIcon
211
- url={optimizeImage(business?.logo, 'h_300,c_limit')}
212
- src={optimizeImage(!business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
213
- style={styles.minilogo}
214
- />
215
- </Logo>
216
- )}
217
- </View>
229
+ {order?.business?.map((business: any, i: number) => i < 2 && (
230
+ <Logo
231
+ isMulti
232
+ key={business?.id}
233
+ style={styles.logoWrapper}
234
+ >
235
+ <FastImage
236
+ style={styles.minilogo}
237
+ source={business?.logo ? {
238
+ uri: optimizeImage(business?.logo, 'h_300,c_limit'),
239
+ priority: FastImage.priority.normal,
240
+ } : theme?.images?.dummies?.businessLogo}
241
+ resizeMode={FastImage.resizeMode.contain}
242
+ />
243
+ </Logo>
218
244
  ))}
245
+ {order?.business?.length > 1 && (order?.business?.length - 2) > 0 && (
246
+ <OText mRight={3}> + {order?.business?.length - 2}</OText>
247
+ )}
219
248
  </MultiLogosContainer>
220
249
  ) : (
221
250
  <Logo style={styles.logoWrapper}>
222
- <OIcon
223
- url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
224
- src={optimizeImage(!order.business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
251
+ <FastImage
225
252
  style={styles.logo}
253
+ source={order.business?.logo ? {
254
+ uri: optimizeImage(order.business?.logo, 'h_300,c_limit'),
255
+ priority: FastImage.priority.normal,
256
+ } : theme?.images?.dummies?.businessLogo}
257
+ resizeMode={FastImage.resizeMode.contain}
226
258
  />
227
259
  </Logo>
228
260
  )}
@@ -230,11 +262,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
230
262
  )}
231
263
  <CardInfoWrapper>
232
264
  <ContentHeader>
233
- <View style={{ flex: 1 }}>
234
- <OText size={12} lineHeight={18} weight={'600'} numberOfLines={1} ellipsizeMode={'tail'}>
235
- {order?.business?.length > 1 ? `${t('GROUP_ORDER', 'Group Order')} ${t('No', 'No')}. ${order?.cart_group_id}` : order.business?.name}
236
- </OText>
237
- </View>
265
+ {(order?.business?.length > 1 && !hideOrderNumber) || (!order?.business?.length && !hideBusinessName) && (
266
+ <View style={{ flex: 1 }}>
267
+ <OText size={12} lineHeight={18} weight={'600'} numberOfLines={1} ellipsizeMode={'tail'}>
268
+ {order?.business?.length > 1 ? `${t('GROUP_ORDER', 'Group Order')} ${t('No', 'No')}. ${order?.cart_group_id}` : order.business?.name}
269
+ </OText>
270
+ </View>
271
+ )}
238
272
  {!!!pastOrders && (
239
273
  <>
240
274
  {isMessageView ? (
@@ -258,8 +292,9 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
258
292
  )}
259
293
  {!!pastOrders && (
260
294
  <ButtonWrapper>
261
- {allowedOrderStatus.includes(parseInt(order?.status)) &&
262
- !order.review && (
295
+ {!hideReviewOrderButton &&
296
+ allowedOrderStatus.includes(parseInt(order?.status)) &&
297
+ !order.review && order?.cart && (
263
298
  <TouchableOpacity
264
299
  onPress={() => handleClickOrderReview(order)}
265
300
  style={styles.reviewButton}>
@@ -268,7 +303,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
268
303
  </OText>
269
304
  </TouchableOpacity>
270
305
  )}
271
- {order.cart && (
306
+ {!hideReorderButton && typeof order?.id === 'number' && order?.cart && (
272
307
  <OButton
273
308
  text={t('REORDER', 'Reorder')}
274
309
  imgRightSrc={''}
@@ -288,7 +323,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
288
323
  <ContentFooter>
289
324
  <View style={{ flex: 1 }}>
290
325
  <View style={styles.infoText}>
291
- {(!!!pastOrders || order?.business?.length > 1) && (
326
+ {(!!!pastOrders || order?.business?.length > 1) && !hideOrderNumber && (
292
327
  <>
293
328
  <OText
294
329
  size={10}
@@ -311,33 +346,37 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
311
346
  </OText>
312
347
  </>
313
348
  )}
349
+ {!hideDate && (
350
+ <OText
351
+ size={10}
352
+ lineHeight={15}
353
+ color={theme.colors.textSecondary}
354
+ style={{ marginVertical: 3 }}
355
+ numberOfLines={1}>
356
+ {
357
+ pastOrders
358
+ ? order?.delivery_datetime_utc ? parseDate(order?.delivery_datetime_utc) : parseDate(order?.delivery_datetime, { utc: false })
359
+ : <OrderEta order={order} />
360
+ }
361
+ </OText>
362
+ )}
363
+ </View>
364
+ {!hideOrderStatus && (
314
365
  <OText
366
+ color={theme.colors.primary}
315
367
  size={10}
316
368
  lineHeight={15}
317
- color={theme.colors.textSecondary}
318
- style={{ marginVertical: 3 }}
319
369
  numberOfLines={1}>
320
- {
321
- pastOrders
322
- ? order?.delivery_datetime_utc ? parseDate(order?.delivery_datetime_utc) : parseDate(order?.delivery_datetime, { utc: false })
323
- : order?.eta_time + 'min'
324
- }
370
+ {getOrderStatus(order.status)?.value}
325
371
  </OText>
326
- </View>
327
- <OText
328
- color={theme.colors.primary}
329
- size={10}
330
- lineHeight={15}
331
- numberOfLines={1}>
332
- {getOrderStatus(order.status)?.value}
333
- </OText>
372
+ )}
334
373
  </View>
335
- {!isMessageView && !order?.business?.length && (
374
+ {!isMessageView && !order?.business?.length && !hideFavorite && (
336
375
  <LottieAnimation
337
376
  type='favorite'
338
377
  onClick={handleChangeFavorite}
339
- initialValue={order?.favorite ? 0.75 : 0}
340
- toValue={order?.favorite ? 0 : 0.75}
378
+ initialValue={order?.favorite ? 0.5 : 0}
379
+ toValue={order?.favorite ? 0 : 0.5}
341
380
  style={{ marginBottom: 5 }}
342
381
  iconProps={{ color: theme.colors.danger5, size: 16, style: { top: 7 } }}
343
382
  isActive={order?.favorite}
@@ -19,7 +19,7 @@ export const CardInfoWrapper = styled.View`
19
19
 
20
20
  export const ContentHeader = styled.View`
21
21
  flex-direction: row;
22
- justify-content: space-between;
22
+ justify-content: flex-end;
23
23
  `
24
24
 
25
25
  export const ButtonWrapper = styled.View`