ordering-ui-react-native 0.16.36 → 0.16.37-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 (195) 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 +2 -2
  80. package/themes/original/src/components/AddressForm/index.tsx +151 -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 +190 -113
  86. package/themes/original/src/components/BusinessController/styles.tsx +0 -7
  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 +80 -128
  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 +278 -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 +78 -67
  110. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  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/GoogleMap/index.tsx +20 -12
  118. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  119. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  120. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  121. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  122. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -72
  124. package/themes/original/src/components/LoginForm/index.tsx +107 -50
  125. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  126. package/themes/original/src/components/Messages/index.tsx +17 -17
  127. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  128. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  129. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  130. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  131. package/themes/original/src/components/MyOrders/index.tsx +70 -6
  132. package/themes/original/src/components/NavBar/index.tsx +15 -9
  133. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  134. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  135. package/themes/original/src/components/Notifications/index.tsx +148 -0
  136. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  137. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  138. package/themes/original/src/components/OrderDetails/index.tsx +200 -37
  139. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  140. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  141. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  142. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  143. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  144. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  145. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  146. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  147. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
  148. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  149. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  150. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  151. package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
  152. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  153. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  154. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  155. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  156. package/themes/original/src/components/ProductForm/index.tsx +635 -664
  157. package/themes/original/src/components/ProductForm/styles.tsx +9 -8
  158. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  159. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  160. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  161. package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
  162. package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
  163. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  164. package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
  165. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  166. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  167. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  168. package/themes/original/src/components/ServiceForm/index.tsx +410 -258
  169. package/themes/original/src/components/SignupForm/index.tsx +362 -210
  170. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  171. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  172. package/themes/original/src/components/SingleProductCard/index.tsx +200 -110
  173. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -10
  174. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  175. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  176. package/themes/original/src/components/StripeElementsForm/index.tsx +18 -7
  177. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  178. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  179. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  180. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  181. package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
  182. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  183. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  184. package/themes/original/src/components/Wallets/index.tsx +176 -164
  185. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  186. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  187. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  188. package/themes/original/src/components/shared/OButton.tsx +10 -3
  189. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  190. package/themes/original/src/components/shared/OInput.tsx +13 -3
  191. package/themes/original/src/layouts/Container.tsx +13 -9
  192. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  193. package/themes/original/src/types/index.tsx +91 -30
  194. package/themes/original/src/utils/index.tsx +121 -10
  195. 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,
@@ -18,10 +19,12 @@ import {
18
19
  } from 'ordering-components/native';
19
20
  import { useTheme } from 'styled-components/native';
20
21
  import { FormSide, FormInput, SocialButtons } from './styles';
22
+ import { Otp } from '../LoginForm/Otp'
21
23
 
22
24
  import {
23
25
  ButtonsWrapper,
24
26
  LoginWith as SignupWith,
27
+ TabBtn,
25
28
  OTab,
26
29
  OTabs,
27
30
  RecaptchaButton
@@ -30,7 +33,9 @@ import {
30
33
  import NavBar from '../NavBar';
31
34
  import { VerifyPhone } from '../VerifyPhone';
32
35
 
33
- import { OText, OButton, OInput, OModal } from '../shared';
36
+ import Alert from '../../../../../src/providers/AlertProvider'
37
+ import { OText, OButton, OInput } from '../shared';
38
+ import { OModal } from '../../../../../src/components/shared';
34
39
  import { SignupParams } from '../../types';
35
40
  import { sortInputFields } from '../../utils';
36
41
  import { GoogleLogin } from '../GoogleLogin';
@@ -67,7 +72,18 @@ const SignupFormUI = (props: SignupParams) => {
67
72
  notificationState,
68
73
  handleChangePromotions,
69
74
  enableReCaptcha,
70
- handleReCaptcha
75
+ handleReCaptcha,
76
+ generateOtpCode,
77
+ numOtpInputs,
78
+ setWillVerifyOtpState,
79
+ handleChangeInput,
80
+ willVerifyOtpState,
81
+ setOtpState,
82
+ setSignUpTab,
83
+ signUpTab,
84
+ useSignUpFullDetails,
85
+ useSignUpOtpEmail,
86
+ useSignUpOtpCellphone
71
87
  } = props;
72
88
 
73
89
  const theme = useTheme();
@@ -104,15 +120,12 @@ const SignupFormUI = (props: SignupParams) => {
104
120
  const [, t] = useLanguage();
105
121
  const [, { login }] = useSession();
106
122
  const [{ configs }] = useConfig();
107
- const { control, handleSubmit, errors, register, setValue } = useForm();
123
+ const { control, handleSubmit, clearErrors, errors, register, unregister, setValue } = useForm();
108
124
 
109
125
  const [passwordSee, setPasswordSee] = useState(false);
110
126
  const [formValues, setFormValues] = useState(null);
111
127
  const [isModalVisible, setIsModalVisible] = useState(false);
112
128
  const [isLoadingVerifyModal, setIsLoadingVerifyModal] = useState(false);
113
- const [signupTab, setSignupTab] = useState(
114
- useSignupByCellphone && !useSignupByEmail ? 'cellphone' : 'email',
115
- );
116
129
  const [isFBLoading, setIsFBLoading] = useState(false);
117
130
  const [phoneInputData, setPhoneInputData] = useState({
118
131
  error: '',
@@ -122,9 +135,12 @@ const SignupFormUI = (props: SignupParams) => {
122
135
  country_code: null
123
136
  },
124
137
  });
138
+ const [alertState, setAlertState] = useState({ open: false, title: '', content: [] })
125
139
  const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
126
140
  const [recaptchaVerified, setRecaptchaVerified] = useState(false)
141
+ const [tabLayouts, setTabLayouts] = useState<any>({})
127
142
 
143
+ const tabsRef = useRef<any>(null)
128
144
  const nameRef = useRef<any>(null);
129
145
  const lastnameRef = useRef<any>(null);
130
146
  const middleNameRef = useRef<any>(null);
@@ -137,7 +153,15 @@ const SignupFormUI = (props: SignupParams) => {
137
153
  const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
138
154
  const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
139
155
  const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
140
- const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
156
+ const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
157
+
158
+ const closeAlert = () => {
159
+ setAlertState({
160
+ open: false,
161
+ title: '',
162
+ content: []
163
+ })
164
+ }
141
165
 
142
166
  const handleRefs = (ref: any, code: string) => {
143
167
  switch (code) {
@@ -163,6 +187,13 @@ const SignupFormUI = (props: SignupParams) => {
163
187
  }
164
188
  };
165
189
 
190
+ const handleOnLayout = (event: any, opc: string) => {
191
+ const _tabLayouts = { ...tabLayouts }
192
+ const categoryKey = opc
193
+ _tabLayouts[categoryKey] = event.nativeEvent.layout
194
+ setTabLayouts(_tabLayouts)
195
+ }
196
+
166
197
  const handleFocusRef = (code: string) => {
167
198
  switch (code) {
168
199
  case 'name': {
@@ -206,14 +237,15 @@ const SignupFormUI = (props: SignupParams) => {
206
237
  navigation.navigate('Home');
207
238
  };
208
239
 
209
- const handleChangeTab = (val: string) => {
210
- setSignupTab(val);
211
- setPasswordSee(false);
212
- };
240
+ const handleSignUpTab = (tab: string) => {
241
+ setSignUpTab && setSignUpTab(tab)
242
+ clearErrors()
243
+ }
213
244
 
214
- const onSubmit = (values: any) => {
215
- if (phoneInputData.error) {
245
+ const onSubmit = (values?: any) => {
246
+ if (phoneInputData.error && signUpTab !== 'otpEmail') {
216
247
  showToast(ToastType.Error, phoneInputData.error);
248
+ Vibration.vibrate()
217
249
  return;
218
250
  }
219
251
  if (
@@ -221,7 +253,8 @@ const SignupFormUI = (props: SignupParams) => {
221
253
  !phoneInputData.phone.cellphone &&
222
254
  ((validationFields?.fields?.checkout?.cellphone?.enabled &&
223
255
  validationFields?.fields?.checkout?.cellphone?.required) ||
224
- configs?.verification_phone_required?.value === '1')
256
+ configs?.verification_phone_required?.value === '1') &&
257
+ signUpTab !== 'otpEmail'
225
258
  ) {
226
259
  showToast(
227
260
  ToastType.Error,
@@ -230,28 +263,32 @@ const SignupFormUI = (props: SignupParams) => {
230
263
  'The field Mobile phone is required.',
231
264
  ),
232
265
  );
266
+ Vibration.vibrate()
233
267
  return;
234
268
  }
235
- if (signupTab === 'email' || !useSignupByCellphone) {
236
- handleButtonSignupClick &&
237
- handleButtonSignupClick({
238
- ...values,
239
- ...((phoneInputData.phone.cellphone !== null && phoneInputData.phone.country_phone_code !== null) && { ...phoneInputData.phone }),
240
- country_code: phoneInputData.phone.country_code
241
- });
242
- if (
243
- !formState.loading &&
244
- formState.result.result &&
245
- !formState.result.error
246
- ) {
247
- handleSuccessSignup && handleSuccessSignup(formState.result.result);
248
- }
249
- return;
269
+ if (signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') {
270
+ generateOtpCode && generateOtpCode({
271
+ ...values,
272
+ ...((phoneInputData.phone.cellphone !== null && phoneInputData.phone.country_phone_code !== null) && { ...phoneInputData.phone }),
273
+ country_code: phoneInputData.phone.country_code
274
+ })
275
+ return
276
+ }
277
+ handleButtonSignupClick &&
278
+ handleButtonSignupClick({
279
+ ...values,
280
+ ...((phoneInputData.phone.cellphone !== null && phoneInputData.phone.country_phone_code !== null) && { ...phoneInputData.phone }),
281
+ country_code: phoneInputData.phone.country_code
282
+ });
283
+ if (!formState.loading && formState.result.result && !formState.result.error) {
284
+ handleSuccessSignup && handleSuccessSignup(formState.result.result);
250
285
  }
251
- setFormValues(values);
252
- handleVerifyCodeClick(values);
253
286
  };
254
287
 
288
+ const handleSingUpOtp = (value: string) => {
289
+ setOtpState && setOtpState(value)
290
+ }
291
+
255
292
  const handleVerifyCodeClick = (values: any) => {
256
293
  const formData = values || formValues;
257
294
  handleSendVerifyCode &&
@@ -295,6 +332,7 @@ const SignupFormUI = (props: SignupParams) => {
295
332
  await Linking.openURL(url);
296
333
  } else {
297
334
  showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
335
+ Vibration.vibrate()
298
336
  }
299
337
  }
300
338
 
@@ -302,10 +340,12 @@ const SignupFormUI = (props: SignupParams) => {
302
340
  setRecaptchaVerified(false)
303
341
  if (!recaptchaConfig?.siteKey) {
304
342
  showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
343
+ Vibration.vibrate()
305
344
  return
306
345
  }
307
346
  if (!recaptchaConfig?.baseUrl) {
308
347
  showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
348
+ Vibration.vibrate()
309
349
  return
310
350
  }
311
351
  recaptchaRef.current.open()
@@ -313,22 +353,47 @@ const SignupFormUI = (props: SignupParams) => {
313
353
 
314
354
  const onRecaptchaVerify = (token: any) => {
315
355
  setRecaptchaVerified(true)
316
- handleReCaptcha(token)
356
+ handleReCaptcha && handleReCaptcha({ code: token, version: recaptchaConfig?.version })
317
357
  }
318
358
 
319
359
  useEffect(() => {
320
360
  if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
321
- setRecaptchaConfig({
322
- siteKey: configs?.security_recaptcha_site_key?.value || null,
323
- baseUrl: configs?.security_recaptcha_base_url?.value || null
324
- })
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
+ }
325
379
  }
326
380
  }, [configs, enableReCaptcha])
327
381
 
328
382
  useEffect(() => {
329
383
  if (!formState.loading && formState.result?.error) {
330
- formState.result?.result &&
331
- 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()
332
397
  setIsLoadingVerifyModal(false);
333
398
  }
334
399
  }, [formState]);
@@ -336,16 +401,21 @@ const SignupFormUI = (props: SignupParams) => {
336
401
  useEffect(() => {
337
402
  if (Object.keys(errors).length > 0) {
338
403
  setIsLoadingVerifyModal(false);
404
+ Vibration.vibrate()
339
405
  }
340
- }, [errors]);
406
+ }, [errors])
341
407
 
342
408
  useEffect(() => {
343
- register('cellphone', {
344
- required: isRequiredField('cellphone')
345
- ? t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required').replace('_attribute_', t('CELLPHONE', 'Cellphone'))
346
- : null
347
- })
348
- }, [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])
349
419
 
350
420
  useEffect(() => {
351
421
  if (phoneInputData?.phone?.cellphone) setValue('cellphone', phoneInputData?.phone?.cellphone, '')
@@ -360,6 +430,7 @@ const SignupFormUI = (props: SignupParams) => {
360
430
  ? verifyPhoneState?.result?.result
361
431
  : verifyPhoneState?.result?.result[0];
362
432
  verifyPhoneState.result?.result && showToast(ToastType.Error, message);
433
+ verifyPhoneState.result?.result && Vibration.vibrate()
363
434
  setIsLoadingVerifyModal(false);
364
435
  return;
365
436
  }
@@ -382,6 +453,16 @@ const SignupFormUI = (props: SignupParams) => {
382
453
  })
383
454
  }, [configs])
384
455
 
456
+ useEffect(() => {
457
+ if (checkPhoneCodeState?.result?.error) {
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
+ })
463
+ }
464
+ }, [checkPhoneCodeState])
465
+
385
466
  return (
386
467
  <View>
387
468
  <NavBar
@@ -395,47 +476,92 @@ const SignupFormUI = (props: SignupParams) => {
395
476
  titleStyle={{ marginLeft: 0, marginRight: 0 }}
396
477
  />
397
478
  <FormSide>
398
- {useSignupByEmail &&
399
- useSignupByCellphone &&
400
- configs &&
401
- Object.keys(configs).length > 0 &&
402
- (configs?.twilio_service_enabled?.value === 'true' ||
403
- configs?.twilio_service_enabled?.value === '1') && (
404
- <SignupWith style={{ paddingBottom: 25 }}>
405
- <OTabs>
406
- {useSignupByEmail && (
407
- <Pressable onPress={() => handleChangeTab('email')}>
408
- <OTab>
409
- <OText
410
- size={18}
411
- color={
412
- signupTab === 'email'
413
- ? theme.colors.primary
414
- : theme.colors.disabled
415
- }>
416
- {t('SIGNUP_BY_EMAIL', 'Signup by Email')}
417
- </OText>
418
- </OTab>
419
- </Pressable>
420
- )}
421
- {useSignupByCellphone && (
422
- <Pressable onPress={() => handleChangeTab('cellphone')}>
423
- <OTab>
424
- <OText
425
- size={18}
426
- color={
427
- signupTab === 'cellphone'
428
- ? theme.colors.primary
429
- : theme.colors.disabled
430
- }>
431
- {t('SIGNUP_BY_PHONE', 'Signup by Phone')}
432
- </OText>
433
- </OTab>
434
- </Pressable>
435
- )}
436
- </OTabs>
437
- </SignupWith>
438
- )}
479
+ {((Number(useSignUpFullDetails) + Number(useSignUpOtpEmail) + Number(useSignUpOtpCellphone)) > 1) && (
480
+ <SignupWith>
481
+ <OTabs
482
+ horizontal
483
+ showsHorizontalScrollIndicator={false}
484
+ ref={tabsRef}
485
+ >
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
+ )}
511
+ {useSignUpOtpEmail && (
512
+ <TabBtn
513
+ onPress={() => handleSignUpTab('otpEmail')}
514
+ onLayout={(event: any) => handleOnLayout(event, 'otpEmail')}
515
+ >
516
+ <OTab
517
+ style={{
518
+ borderBottomColor:
519
+ signUpTab === 'otpEmail'
520
+ ? theme.colors.textNormal
521
+ : theme.colors.border,
522
+ }}>
523
+ <OText
524
+ size={14}
525
+ color={
526
+ signUpTab === 'otpEmail'
527
+ ? theme.colors.textNormal
528
+ : theme.colors.disabled
529
+ }
530
+ weight={signUpTab === 'otpEmail' ? 'bold' : 'normal'}>
531
+ {t('BY_OTP_EMAIL', 'by Otp Email')}
532
+ </OText>
533
+ </OTab>
534
+ </TabBtn>
535
+
536
+ )}
537
+ {useSignUpOtpCellphone && (
538
+ <TabBtn
539
+ onPress={() => handleSignUpTab('otpCellphone')}
540
+ onLayout={(event: any) => handleOnLayout(event, 'otpCellphone')}
541
+ >
542
+ <OTab
543
+ style={{
544
+ borderBottomColor:
545
+ signUpTab === 'otpCellphone'
546
+ ? theme.colors.textNormal
547
+ : theme.colors.border,
548
+ }}>
549
+ <OText
550
+ size={14}
551
+ color={
552
+ signUpTab === 'otpCellphone'
553
+ ? theme.colors.textNormal
554
+ : theme.colors.disabled
555
+ }
556
+ weight={signUpTab === 'otpCellphone' ? 'bold' : 'normal'}>
557
+ {t('BY_OTP_CELLPHONE', 'by Otp Cellphone')}
558
+ </OText>
559
+ </OTab>
560
+ </TabBtn>
561
+ )}
562
+ </OTabs>
563
+ </SignupWith>
564
+ )}
439
565
  <FormInput>
440
566
  {!(useChekoutFileds && validationFields?.loading) ? (
441
567
  <>
@@ -445,7 +571,9 @@ const SignupFormUI = (props: SignupParams) => {
445
571
  (field: any, i: number) =>
446
572
  !notValidationFields.includes(field.code) &&
447
573
  showField &&
448
- showField(field.code) && (
574
+ showField(field.code) &&
575
+ (signUpTab === 'default' ||
576
+ (signUpTab === 'otpEmail' && field.code === 'email')) && (
449
577
  <React.Fragment key={field.id}>
450
578
  {errors?.[`${field.code}`] && (
451
579
  <OText
@@ -469,7 +597,7 @@ const SignupFormUI = (props: SignupParams) => {
469
597
  value={value}
470
598
  onChange={(val: any) =>
471
599
  field.code !== 'email'
472
- ? onChange(val)
600
+ ? (onChange(val))
473
601
  : handleChangeInputEmail(val, onChange)
474
602
  }
475
603
  autoCapitalize={
@@ -501,7 +629,7 @@ const SignupFormUI = (props: SignupParams) => {
501
629
  ),
502
630
  )}
503
631
 
504
- {!!showInputPhoneNumber && (
632
+ {(!!showInputPhoneNumber && (signUpTab === 'default' || signUpTab === 'otpCellphone')) && (
505
633
  <View style={{ marginBottom: 25 }}>
506
634
  <PhoneInputNumber
507
635
  data={phoneInputData}
@@ -515,7 +643,6 @@ const SignupFormUI = (props: SignupParams) => {
515
643
  }
516
644
  })}
517
645
  forwardRef={phoneRef}
518
- defaultCode={formState?.country_code ?? formState?.country_phone_code ?? null}
519
646
  changeCountry={(val: any) => setPhoneInputData({
520
647
  ...phoneInputData,
521
648
  phone: {
@@ -532,66 +659,79 @@ const SignupFormUI = (props: SignupParams) => {
532
659
  </View>
533
660
  )}
534
661
 
535
- {enableReCaptcha && (
662
+ {(enableReCaptcha && recaptchaConfig?.version) && (
536
663
  <>
537
- <TouchableOpacity
538
- onPress={handleOpenRecaptcha}
539
- style={{ marginHorizontal: 4, marginBottom: 10 }}
540
- >
541
- <RecaptchaButton>
542
- {recaptchaVerified ? (
543
- <MaterialCommunityIcons
544
- name="checkbox-marked"
545
- size={23}
546
- color={theme.colors.primary}
547
- />
548
- ) : (
549
- <MaterialCommunityIcons
550
- name="checkbox-blank-outline"
551
- size={23}
552
- color={theme.colors.disabled}
553
- />
554
- )}
555
- <OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
556
- </RecaptchaButton>
557
- </TouchableOpacity>
558
- <Recaptcha
559
- ref={recaptchaRef}
560
- siteKey={recaptchaConfig?.siteKey}
561
- baseUrl={recaptchaConfig?.baseUrl}
562
- onVerify={onRecaptchaVerify}
563
- onExpire={() => setRecaptchaVerified(false)}
564
- />
565
- </>
566
- )}
567
-
568
- <View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20 }}>
569
- <Controller
570
- control={control}
571
- render={({ onChange, value }: any) => (
572
- <CheckBox
573
- value={value}
574
- onValueChange={newValue => {
575
- onChange(newValue)
576
- handleChangePromotions()
577
- }}
578
- boxType={'square'}
579
- tintColors={{
580
- true: theme.colors.primary,
581
- false: theme.colors.disabled
582
- }}
583
- tintColor={theme.colors.disabled}
584
- onCheckColor={theme.colors.primary}
585
- onTintColor={theme.colors.primary}
586
- style={Platform.OS === 'ios' && style.checkBoxStyle}
664
+ {recaptchaConfig?.version === 'v3' ? (
665
+ <ReCaptcha
666
+ url={recaptchaConfig?.baseUrl}
667
+ siteKey={recaptchaConfig?.siteKey}
668
+ containerStyle={{ height: 40 }}
669
+ onExecute={onRecaptchaVerify}
670
+ reCaptchaType={1}
587
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
+ </>
588
703
  )}
589
- name='promotions'
590
- defaultValue={false}
591
- />
592
- <OText style={{ fontSize: 14, paddingHorizontal: 5 }}>{t('RECEIVE_NEWS_EXCLUSIVE_PROMOTIONS', 'Receive newsletters and exclusive promotions')}</OText>
593
- </View>
594
704
 
705
+ </>
706
+ )}
707
+ {(signUpTab === 'default') && (
708
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20 }}>
709
+ <Controller
710
+ control={control}
711
+ render={({ onChange, value }: any) => (
712
+ <CheckBox
713
+ value={value}
714
+ onValueChange={newValue => {
715
+ onChange(newValue)
716
+ handleChangePromotions()
717
+ }}
718
+ boxType={'square'}
719
+ tintColors={{
720
+ true: theme.colors.primary,
721
+ false: theme.colors.disabled
722
+ }}
723
+ tintColor={theme.colors.disabled}
724
+ onCheckColor={theme.colors.primary}
725
+ onTintColor={theme.colors.primary}
726
+ style={Platform.OS === 'ios' && style.checkBoxStyle}
727
+ />
728
+ )}
729
+ name='promotions'
730
+ defaultValue={false}
731
+ />
732
+ <OText style={{ fontSize: 14, paddingHorizontal: 5 }}>{t('RECEIVE_NEWS_EXCLUSIVE_PROMOTIONS', 'Receive newsletters and exclusive promotions')}</OText>
733
+ </View>
734
+ )}
595
735
  {configs?.terms_and_conditions?.value === 'true' && (
596
736
  <>
597
737
  {errors?.termsAccept && (
@@ -643,7 +783,7 @@ const SignupFormUI = (props: SignupParams) => {
643
783
 
644
784
  )}
645
785
 
646
- {signupTab !== 'cellphone' && (
786
+ {signUpTab === 'default' && (
647
787
  <>
648
788
  {errors?.password && (
649
789
  <OText
@@ -715,9 +855,7 @@ const SignupFormUI = (props: SignupParams) => {
715
855
  <Spinner visible />
716
856
  )}
717
857
 
718
- {signupTab === 'cellphone' &&
719
- useSignupByEmail &&
720
- useSignupByCellphone ? (
858
+ {(signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') ? (
721
859
  <OButton
722
860
  onClick={handleSubmit(onSubmit)}
723
861
  text={t('GET_VERIFY_CODE', 'Get Verify Code')}
@@ -756,86 +894,100 @@ const SignupFormUI = (props: SignupParams) => {
756
894
  </View>
757
895
  )
758
896
  }
759
- <View
760
- style={{
761
- flexDirection: 'row',
762
- width: '100%',
763
- justifyContent: 'space-between',
764
- alignItems: 'center',
765
- marginVertical: 30,
766
- }}>
767
- <View style={style.line} />
768
- <OText
769
- size={14}
770
- mBottom={10}
771
- style={{ paddingHorizontal: 19 }}
772
- color={theme.colors.disabled}>
773
- {t('OR', 'or')}
774
- </OText>
775
- <View style={style.line} />
776
- </View>
777
-
778
897
  {configs && Object.keys(configs).length > 0 && (
779
- (((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
780
- (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)) &&
781
901
  (
782
- <ButtonsWrapper>
783
- <SocialButtons>
784
- {(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
785
- configs?.facebook_id?.value &&
786
- facebookLoginEnabled &&
787
- (
788
- <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
789
936
  notificationState={notificationState}
790
- 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() }}
791
939
  handleLoading={(val: boolean) => setIsFBLoading(val)}
792
- handleSuccessFacebookLogin={handleSuccessFacebook}
940
+ handleSuccessGoogleLogin={handleSuccessFacebook}
793
941
  />
794
942
  )}
795
- {(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
796
- <GoogleLogin
797
- notificationState={notificationState}
798
- webClientId={configs?.google_login_client_id?.value}
799
- handleErrors={(err: any) => showToast(ToastType.Error, err)}
800
- handleLoading={(val: boolean) => setIsFBLoading(val)}
801
- handleSuccessGoogleLogin={handleSuccessFacebook}
802
- />
803
- )}
804
- {(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
805
- <AppleLogin
806
- notificationState={notificationState}
807
- handleErrors={(err: any) => showToast(ToastType.Error, err)}
808
- handleLoading={(val: boolean) => setIsFBLoading(val)}
809
- handleSuccessAppleLogin={handleSuccessFacebook}
810
- />
811
- )}
812
- </SocialButtons>
813
- </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
+ </>
814
954
  )
815
955
  )}
816
-
817
956
  </FormSide>
818
- <OModal open={isModalVisible} onClose={() => setIsModalVisible(false)}>
819
- <VerifyPhone
820
- phone={phoneInputData.phone}
821
- formValues={formValues}
822
- verifyPhoneState={verifyPhoneState}
823
- checkPhoneCodeState={checkPhoneCodeState}
824
- handleCheckPhoneCode={handleCheckPhoneCode}
825
- setCheckPhoneCodeState={setCheckPhoneCodeState}
826
- handleVerifyCodeClick={onSubmit}
957
+ <OModal
958
+ open={willVerifyOtpState}
959
+ onClose={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
960
+ entireModal
961
+ title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
962
+ >
963
+ <Otp
964
+ pinCount={numOtpInputs || 6}
965
+ willVerifyOtpState={willVerifyOtpState || false}
966
+ setWillVerifyOtpState={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
967
+ handleLoginOtp={handleSingUpOtp}
968
+ onSubmit={onSubmit}
969
+ setAlertState={setAlertState}
827
970
  />
828
971
  </OModal>
829
972
  <Spinner
830
973
  visible={formState.loading || validationFields.loading || isFBLoading}
831
974
  />
975
+ <Alert
976
+ open={alertState.open}
977
+ content={alertState.content}
978
+ title={alertState.title || ''}
979
+ onAccept={closeAlert}
980
+ onClose={closeAlert}
981
+ />
832
982
  </View>
833
983
  );
834
984
  };
835
985
 
836
986
  export const SignupForm = (props: any) => {
987
+ const _numOtpInputs = 6
837
988
  const signupProps = {
838
989
  ...props,
990
+ numOtpInputs: _numOtpInputs,
839
991
  isRecaptchaEnable: true,
840
992
  UIComponent: SignupFormUI,
841
993
  };