ordering-ui-react-native 0.16.37 → 0.16.38-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 (202) hide show
  1. package/package.json +7 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  6. package/src/components/BusinessInformation/index.tsx +33 -4
  7. package/src/components/BusinessInformation/styles.tsx +2 -2
  8. package/src/components/BusinessProductsList/index.tsx +10 -10
  9. package/src/components/BusinessesListing/index.tsx +1 -1
  10. package/src/components/Checkout/index.tsx +2 -1
  11. package/src/components/LanguageSelector/index.tsx +21 -16
  12. package/src/components/LoginForm/index.tsx +15 -0
  13. package/src/components/Messages/index.tsx +2 -2
  14. package/src/components/NotificationSetting/index.tsx +85 -0
  15. package/src/components/OrderDetails/index.tsx +2 -20
  16. package/src/components/OrdersOption/index.tsx +54 -56
  17. package/src/components/PaymentOptions/index.tsx +335 -365
  18. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  19. package/src/components/ReviewDriver/index.tsx +1 -1
  20. package/src/components/ReviewOrder/index.tsx +2 -1
  21. package/src/components/ReviewProducts/index.tsx +11 -0
  22. package/src/components/SignupForm/index.tsx +15 -0
  23. package/src/components/SingleProductReview/index.tsx +8 -5
  24. package/src/components/StripeElementsForm/index.tsx +25 -16
  25. package/src/components/VerifyPhone/styles.tsx +1 -2
  26. package/src/components/shared/OBottomPopup.tsx +6 -2
  27. package/src/index.tsx +2 -0
  28. package/src/pages/BusinessesListing.tsx +7 -6
  29. package/src/pages/OrderDetails.tsx +1 -1
  30. package/src/pages/ReviewDriver.tsx +2 -2
  31. package/src/pages/ReviewOrder.tsx +2 -2
  32. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  33. package/src/utils/index.tsx +2 -1
  34. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  35. package/themes/business/src/components/Chat/index.tsx +38 -30
  36. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  37. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  38. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  39. package/themes/business/src/components/MapView/index.tsx +12 -1
  40. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  41. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  42. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  43. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  44. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  45. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  46. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  47. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  48. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  49. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  50. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  51. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  52. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  53. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  54. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  55. package/themes/business/src/components/PreviousOrders/index.tsx +22 -24
  56. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  57. package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
  58. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  59. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  60. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  61. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  62. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  63. package/themes/business/src/types/index.tsx +15 -9
  64. package/themes/business/src/utils/index.tsx +10 -0
  65. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  66. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  67. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  68. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  69. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  70. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  71. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  72. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  73. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  74. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  75. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  76. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  77. package/themes/kiosk/src/types/index.d.ts +2 -0
  78. package/themes/original/index.tsx +4 -0
  79. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  80. package/themes/original/src/components/AddressForm/index.tsx +157 -140
  81. package/themes/original/src/components/AddressList/index.tsx +1 -1
  82. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  83. package/themes/original/src/components/BusinessBasicInformation/index.tsx +324 -162
  84. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  85. package/themes/original/src/components/BusinessController/index.tsx +216 -113
  86. package/themes/original/src/components/BusinessController/styles.tsx +1 -8
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  88. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  89. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  93. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  94. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
  96. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  97. package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -104
  98. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
  99. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  100. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  101. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
  102. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +279 -104
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
  105. package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
  106. package/themes/original/src/components/Cart/index.tsx +54 -16
  107. package/themes/original/src/components/Cart/styles.tsx +4 -0
  108. package/themes/original/src/components/CartContent/index.tsx +22 -16
  109. package/themes/original/src/components/Checkout/index.tsx +110 -116
  110. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  111. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  112. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  113. package/themes/original/src/components/Favorite/index.tsx +1 -0
  114. package/themes/original/src/components/FavoriteList/index.tsx +32 -2
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  118. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  119. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  120. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  121. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  122. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  123. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  124. package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -73
  125. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  126. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  127. package/themes/original/src/components/Messages/index.tsx +17 -17
  128. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  129. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  130. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  131. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  132. package/themes/original/src/components/MyOrders/index.tsx +88 -22
  133. package/themes/original/src/components/NavBar/index.tsx +15 -9
  134. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  135. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  136. package/themes/original/src/components/Notifications/index.tsx +148 -0
  137. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  138. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  139. package/themes/original/src/components/OrderDetails/index.tsx +200 -37
  140. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  141. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  142. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  143. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  144. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  145. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  146. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  147. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  148. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  150. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  151. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  152. package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
  153. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  154. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  155. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  156. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  157. package/themes/original/src/components/ProductForm/index.tsx +635 -664
  158. package/themes/original/src/components/ProductForm/styles.tsx +10 -11
  159. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  160. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  161. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  162. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  163. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  164. package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
  165. package/themes/original/src/components/Promotions/index.tsx +232 -219
  166. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  167. package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
  168. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  169. package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
  170. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  171. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  172. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  173. package/themes/original/src/components/ServiceForm/index.tsx +410 -258
  174. package/themes/original/src/components/SignupForm/index.tsx +184 -127
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  177. package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
  179. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  180. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +18 -7
  182. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  183. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  184. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  185. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  186. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  187. package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
  188. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  189. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  190. package/themes/original/src/components/Wallets/index.tsx +176 -164
  191. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  192. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  193. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  194. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  195. package/themes/original/src/components/shared/OButton.tsx +10 -3
  196. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  197. package/themes/original/src/components/shared/OInput.tsx +13 -3
  198. package/themes/original/src/layouts/Container.tsx +13 -9
  199. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  200. package/themes/original/src/types/index.tsx +82 -29
  201. package/themes/original/src/utils/index.tsx +121 -10
  202. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity } from 'react-native';
2
+ import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity, Vibration } 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';
@@ -7,6 +7,7 @@ import CheckBox from '@react-native-community/checkbox';
7
7
  import { PhoneInputNumber } from '../PhoneInputNumber';
8
8
  import { FacebookLogin } from '../FacebookLogin';
9
9
  import Recaptcha from 'react-native-recaptcha-that-works'
10
+ import ReCaptcha from '@fatnlazycat/react-native-recaptcha-v3'
10
11
 
11
12
  import {
12
13
  SignupForm as SignUpController,
@@ -78,7 +79,6 @@ const SignupFormUI = (props: SignupParams) => {
78
79
  handleChangeInput,
79
80
  willVerifyOtpState,
80
81
  setOtpState,
81
- otpState,
82
82
  setSignUpTab,
83
83
  signUpTab,
84
84
  useSignUpFullDetails,
@@ -120,10 +120,9 @@ const SignupFormUI = (props: SignupParams) => {
120
120
  const [, t] = useLanguage();
121
121
  const [, { login }] = useSession();
122
122
  const [{ configs }] = useConfig();
123
- const { control, handleSubmit, errors, register, setValue } = useForm();
123
+ const { control, handleSubmit, clearErrors, errors, register, unregister, setValue } = useForm();
124
124
 
125
125
  const [passwordSee, setPasswordSee] = useState(false);
126
- const [otpErrMsg, setOtpErrMsg] = useState('')
127
126
  const [formValues, setFormValues] = useState(null);
128
127
  const [isModalVisible, setIsModalVisible] = useState(false);
129
128
  const [isLoadingVerifyModal, setIsLoadingVerifyModal] = useState(false);
@@ -238,9 +237,15 @@ const SignupFormUI = (props: SignupParams) => {
238
237
  navigation.navigate('Home');
239
238
  };
240
239
 
240
+ const handleSignUpTab = (tab: string) => {
241
+ setSignUpTab && setSignUpTab(tab)
242
+ clearErrors()
243
+ }
244
+
241
245
  const onSubmit = (values?: any) => {
242
246
  if (phoneInputData.error && signUpTab !== 'otpEmail') {
243
247
  showToast(ToastType.Error, phoneInputData.error);
248
+ Vibration.vibrate()
244
249
  return;
245
250
  }
246
251
  if (
@@ -258,6 +263,7 @@ const SignupFormUI = (props: SignupParams) => {
258
263
  'The field Mobile phone is required.',
259
264
  ),
260
265
  );
266
+ Vibration.vibrate()
261
267
  return;
262
268
  }
263
269
  if (signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') {
@@ -326,6 +332,7 @@ const SignupFormUI = (props: SignupParams) => {
326
332
  await Linking.openURL(url);
327
333
  } else {
328
334
  showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
335
+ Vibration.vibrate()
329
336
  }
330
337
  }
331
338
 
@@ -333,10 +340,12 @@ const SignupFormUI = (props: SignupParams) => {
333
340
  setRecaptchaVerified(false)
334
341
  if (!recaptchaConfig?.siteKey) {
335
342
  showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
343
+ Vibration.vibrate()
336
344
  return
337
345
  }
338
346
  if (!recaptchaConfig?.baseUrl) {
339
347
  showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
348
+ Vibration.vibrate()
340
349
  return
341
350
  }
342
351
  recaptchaRef.current.open()
@@ -344,22 +353,47 @@ const SignupFormUI = (props: SignupParams) => {
344
353
 
345
354
  const onRecaptchaVerify = (token: any) => {
346
355
  setRecaptchaVerified(true)
347
- handleReCaptcha(token)
356
+ handleReCaptcha && handleReCaptcha({ code: token, version: recaptchaConfig?.version })
348
357
  }
349
358
 
350
359
  useEffect(() => {
351
360
  if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
352
- setRecaptchaConfig({
353
- siteKey: configs?.security_recaptcha_site_key?.value || null,
354
- baseUrl: configs?.security_recaptcha_base_url?.value || null
355
- })
361
+ if (configs?.security_recaptcha_type?.value === 'v3' &&
362
+ configs?.security_recaptcha_score_v3?.value > 0 &&
363
+ configs?.security_recaptcha_site_key_v3?.value
364
+ ) {
365
+ setRecaptchaConfig({
366
+ version: 'v3',
367
+ siteKey: configs?.security_recaptcha_site_key_v3?.value || null,
368
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
369
+ })
370
+ return
371
+ }
372
+ if (configs?.security_recaptcha_site_key?.value) {
373
+ setRecaptchaConfig({
374
+ version: 'v2',
375
+ siteKey: configs?.security_recaptcha_site_key?.value || null,
376
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
377
+ })
378
+ }
356
379
  }
357
380
  }, [configs, enableReCaptcha])
358
381
 
359
382
  useEffect(() => {
360
383
  if (!formState.loading && formState.result?.error) {
361
- formState.result?.result &&
362
- showToast(ToastType.Error, formState.result?.result[0]);
384
+ if (formState.result?.result?.[0] === 'ERROR_AUTH_VERIFICATION_CODE') {
385
+ setRecaptchaVerified(false)
386
+ setRecaptchaConfig({
387
+ version: 'v2',
388
+ siteKey: configs?.security_recaptcha_site_key?.value || null,
389
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
390
+ })
391
+ showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
392
+ Vibration.vibrate()
393
+ return
394
+ }
395
+ formState.result?.result && showToast(ToastType.Error, formState.result?.result[0]);
396
+ formState.result?.result && Vibration.vibrate()
363
397
  setIsLoadingVerifyModal(false);
364
398
  }
365
399
  }, [formState]);
@@ -367,16 +401,21 @@ const SignupFormUI = (props: SignupParams) => {
367
401
  useEffect(() => {
368
402
  if (Object.keys(errors).length > 0) {
369
403
  setIsLoadingVerifyModal(false);
404
+ Vibration.vibrate()
370
405
  }
371
- }, [errors]);
406
+ }, [errors])
372
407
 
373
408
  useEffect(() => {
374
- register('cellphone', {
375
- required: isRequiredField('cellphone')
376
- ? t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required').replace('_attribute_', t('CELLPHONE', 'Cellphone'))
377
- : null
378
- })
379
- }, [register])
409
+ if (signUpTab === 'default' || signUpTab === 'otpCellphone') {
410
+ register('cellphone', {
411
+ required: isRequiredField('cellphone')
412
+ ? t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required').replace('_attribute_', t('CELLPHONE', 'Cellphone'))
413
+ : null
414
+ })
415
+ } else {
416
+ unregister('cellphone')
417
+ }
418
+ }, [signUpTab])
380
419
 
381
420
  useEffect(() => {
382
421
  if (phoneInputData?.phone?.cellphone) setValue('cellphone', phoneInputData?.phone?.cellphone, '')
@@ -391,6 +430,7 @@ const SignupFormUI = (props: SignupParams) => {
391
430
  ? verifyPhoneState?.result?.result
392
431
  : verifyPhoneState?.result?.result[0];
393
432
  verifyPhoneState.result?.result && showToast(ToastType.Error, message);
433
+ verifyPhoneState.result?.result && Vibration.vibrate()
394
434
  setIsLoadingVerifyModal(false);
395
435
  return;
396
436
  }
@@ -415,9 +455,11 @@ const SignupFormUI = (props: SignupParams) => {
415
455
 
416
456
  useEffect(() => {
417
457
  if (checkPhoneCodeState?.result?.error) {
418
- setOtpErrMsg((typeof checkPhoneCodeState?.result?.result === 'string' ? checkPhoneCodeState?.result?.result : checkPhoneCodeState?.result?.result[0]) || t('ERROR', 'Error'))
419
- } else if (checkPhoneCodeState?.result?.result && checkPhoneCodeState?.result?.result?.[0] === 'VERIFICATION_CODE_WAS_SENT_TO') {
420
- setOtpErrMsg(t('CODE_SENT', 'The code has been sent'))
458
+ setAlertState({
459
+ open: true,
460
+ title: (typeof checkPhoneCodeState?.result?.result === 'string' ? checkPhoneCodeState?.result?.result : checkPhoneCodeState?.result?.result[0].toString()) || t('ERROR', 'Error'),
461
+ content: []
462
+ })
421
463
  }
422
464
  }, [checkPhoneCodeState])
423
465
 
@@ -434,39 +476,41 @@ const SignupFormUI = (props: SignupParams) => {
434
476
  titleStyle={{ marginLeft: 0, marginRight: 0 }}
435
477
  />
436
478
  <FormSide>
437
- {(useSignUpFullDetails) && (
479
+ {((Number(useSignUpFullDetails) + Number(useSignUpOtpEmail) + Number(useSignUpOtpCellphone)) > 1) && (
438
480
  <SignupWith>
439
481
  <OTabs
440
482
  horizontal
441
483
  showsHorizontalScrollIndicator={false}
442
484
  ref={tabsRef}
443
485
  >
444
- <TabBtn
445
- onPress={() => setSignUpTab && setSignUpTab('default')}
446
- onLayout={(event: any) => handleOnLayout(event, 'default')}
447
- >
448
- <OTab
449
- style={{
450
- borderBottomColor:
451
- signUpTab === 'default'
452
- ? theme.colors.textNormal
453
- : theme.colors.border,
454
- }}>
455
- <OText
456
- size={14}
457
- color={
458
- signUpTab === 'default'
459
- ? theme.colors.textNormal
460
- : theme.colors.disabled
461
- }
462
- weight={signUpTab === 'default' ? 'bold' : 'normal'}>
463
- {t('DEFAULT', 'Default')}
464
- </OText>
465
- </OTab>
466
- </TabBtn>
486
+ {useSignUpFullDetails && (
487
+ <TabBtn
488
+ onPress={() => handleSignUpTab('default')}
489
+ onLayout={(event: any) => handleOnLayout(event, 'default')}
490
+ >
491
+ <OTab
492
+ style={{
493
+ borderBottomColor:
494
+ signUpTab === 'default'
495
+ ? theme.colors.textNormal
496
+ : theme.colors.border,
497
+ }}>
498
+ <OText
499
+ size={14}
500
+ color={
501
+ signUpTab === 'default'
502
+ ? theme.colors.textNormal
503
+ : theme.colors.disabled
504
+ }
505
+ weight={signUpTab === 'default' ? 'bold' : 'normal'}>
506
+ {t('DEFAULT', 'Default')}
507
+ </OText>
508
+ </OTab>
509
+ </TabBtn>
510
+ )}
467
511
  {useSignUpOtpEmail && (
468
512
  <TabBtn
469
- onPress={() => setSignUpTab && setSignUpTab('otpEmail')}
513
+ onPress={() => handleSignUpTab('otpEmail')}
470
514
  onLayout={(event: any) => handleOnLayout(event, 'otpEmail')}
471
515
  >
472
516
  <OTab
@@ -492,7 +536,7 @@ const SignupFormUI = (props: SignupParams) => {
492
536
  )}
493
537
  {useSignUpOtpCellphone && (
494
538
  <TabBtn
495
- onPress={() => setSignUpTab && setSignUpTab('otpCellphone')}
539
+ onPress={() => handleSignUpTab('otpCellphone')}
496
540
  onLayout={(event: any) => handleOnLayout(event, 'otpCellphone')}
497
541
  >
498
542
  <OTab
@@ -599,7 +643,6 @@ const SignupFormUI = (props: SignupParams) => {
599
643
  }
600
644
  })}
601
645
  forwardRef={phoneRef}
602
- defaultCode={formState?.country_code ?? formState?.country_phone_code ?? null}
603
646
  changeCountry={(val: any) => setPhoneInputData({
604
647
  ...phoneInputData,
605
648
  phone: {
@@ -616,36 +659,49 @@ const SignupFormUI = (props: SignupParams) => {
616
659
  </View>
617
660
  )}
618
661
 
619
- {enableReCaptcha && (
662
+ {(enableReCaptcha && recaptchaConfig?.version) && (
620
663
  <>
621
- <TouchableOpacity
622
- onPress={handleOpenRecaptcha}
623
- style={{ marginHorizontal: 4, marginBottom: 10 }}
624
- >
625
- <RecaptchaButton>
626
- {recaptchaVerified ? (
627
- <MaterialCommunityIcons
628
- name="checkbox-marked"
629
- size={23}
630
- color={theme.colors.primary}
631
- />
632
- ) : (
633
- <MaterialCommunityIcons
634
- name="checkbox-blank-outline"
635
- size={23}
636
- color={theme.colors.disabled}
637
- />
638
- )}
639
- <OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
640
- </RecaptchaButton>
641
- </TouchableOpacity>
642
- <Recaptcha
643
- ref={recaptchaRef}
644
- siteKey={recaptchaConfig?.siteKey}
645
- baseUrl={recaptchaConfig?.baseUrl}
646
- onVerify={onRecaptchaVerify}
647
- onExpire={() => setRecaptchaVerified(false)}
648
- />
664
+ {recaptchaConfig?.version === 'v3' ? (
665
+ <ReCaptcha
666
+ url={recaptchaConfig?.baseUrl}
667
+ siteKey={recaptchaConfig?.siteKey}
668
+ containerStyle={{ height: 40 }}
669
+ onExecute={onRecaptchaVerify}
670
+ reCaptchaType={1}
671
+ />
672
+ ) : (
673
+ <>
674
+ <TouchableOpacity
675
+ onPress={handleOpenRecaptcha}
676
+ style={{ marginHorizontal: 4, marginBottom: 10 }}
677
+ >
678
+ <RecaptchaButton>
679
+ {recaptchaVerified ? (
680
+ <MaterialCommunityIcons
681
+ name="checkbox-marked"
682
+ size={23}
683
+ color={theme.colors.primary}
684
+ />
685
+ ) : (
686
+ <MaterialCommunityIcons
687
+ name="checkbox-blank-outline"
688
+ size={23}
689
+ color={theme.colors.disabled}
690
+ />
691
+ )}
692
+ <OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
693
+ </RecaptchaButton>
694
+ </TouchableOpacity>
695
+ <Recaptcha
696
+ ref={recaptchaRef}
697
+ siteKey={recaptchaConfig?.siteKey}
698
+ baseUrl={recaptchaConfig?.baseUrl}
699
+ onVerify={onRecaptchaVerify}
700
+ onExpire={() => setRecaptchaVerified(false)}
701
+ />
702
+ </>
703
+ )}
704
+
649
705
  </>
650
706
  )}
651
707
  {(signUpTab === 'default') && (
@@ -838,64 +894,65 @@ const SignupFormUI = (props: SignupParams) => {
838
894
  </View>
839
895
  )
840
896
  }
841
- <View
842
- style={{
843
- flexDirection: 'row',
844
- width: '100%',
845
- justifyContent: 'space-between',
846
- alignItems: 'center',
847
- marginVertical: 30,
848
- }}>
849
- <View style={style.line} />
850
- <OText
851
- size={14}
852
- mBottom={10}
853
- style={{ paddingHorizontal: 19 }}
854
- color={theme.colors.disabled}>
855
- {t('OR', 'or')}
856
- </OText>
857
- <View style={style.line} />
858
- </View>
859
-
860
897
  {configs && Object.keys(configs).length > 0 && (
861
- (((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
862
- (configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null)) &&
898
+ (((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
899
+ ((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
900
+ ((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
863
901
  (
864
- <ButtonsWrapper>
865
- <SocialButtons>
866
- {(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
867
- configs?.facebook_id?.value &&
868
- facebookLoginEnabled &&
869
- (
870
- <FacebookLogin
902
+ <>
903
+ <View
904
+ style={{
905
+ flexDirection: 'row',
906
+ width: '100%',
907
+ justifyContent: 'space-between',
908
+ alignItems: 'center',
909
+ marginVertical: 30,
910
+ }}>
911
+ <View style={style.line} />
912
+ <OText
913
+ size={14}
914
+ mBottom={10}
915
+ style={{ paddingHorizontal: 19 }}
916
+ color={theme.colors.disabled}>
917
+ {t('OR', 'or')}
918
+ </OText>
919
+ <View style={style.line} />
920
+ </View>
921
+ <ButtonsWrapper>
922
+ <SocialButtons>
923
+ {(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
924
+ configs?.facebook_id?.value &&
925
+ facebookLoginEnabled &&
926
+ (
927
+ <FacebookLogin
928
+ notificationState={notificationState}
929
+ handleErrors={(err: any) => { showToast(ToastType.Error, err), Vibration.vibrate() }}
930
+ handleLoading={(val: boolean) => setIsFBLoading(val)}
931
+ handleSuccessFacebookLogin={handleSuccessFacebook}
932
+ />
933
+ )}
934
+ {(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
935
+ <GoogleLogin
871
936
  notificationState={notificationState}
872
- handleErrors={(err: any) => showToast(ToastType.Error, err)}
937
+ webClientId={configs?.google_login_client_id?.value}
938
+ handleErrors={(err: any) => { showToast(ToastType.Error, err), Vibration.vibrate() }}
873
939
  handleLoading={(val: boolean) => setIsFBLoading(val)}
874
- handleSuccessFacebookLogin={handleSuccessFacebook}
940
+ handleSuccessGoogleLogin={handleSuccessFacebook}
875
941
  />
876
942
  )}
877
- {(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
878
- <GoogleLogin
879
- notificationState={notificationState}
880
- webClientId={configs?.google_login_client_id?.value}
881
- handleErrors={(err: any) => showToast(ToastType.Error, err)}
882
- handleLoading={(val: boolean) => setIsFBLoading(val)}
883
- handleSuccessGoogleLogin={handleSuccessFacebook}
884
- />
885
- )}
886
- {(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
887
- <AppleLogin
888
- notificationState={notificationState}
889
- handleErrors={(err: any) => showToast(ToastType.Error, err)}
890
- handleLoading={(val: boolean) => setIsFBLoading(val)}
891
- handleSuccessAppleLogin={handleSuccessFacebook}
892
- />
893
- )}
894
- </SocialButtons>
895
- </ButtonsWrapper>
943
+ {(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
944
+ <AppleLogin
945
+ notificationState={notificationState}
946
+ handleErrors={(err: any) => { showToast(ToastType.Error, err), Vibration.vibrate() }}
947
+ handleLoading={(val: boolean) => setIsFBLoading(val)}
948
+ handleSuccessAppleLogin={handleSuccessFacebook}
949
+ />
950
+ )}
951
+ </SocialButtons>
952
+ </ButtonsWrapper>
953
+ </>
896
954
  )
897
955
  )}
898
-
899
956
  </FormSide>
900
957
  <OModal
901
958
  open={willVerifyOtpState}