ordering-ui-react-native 0.16.40 → 0.16.41-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.
- package/package.json +7 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +15 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +1 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +15 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +40 -32
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/index.tsx +22 -24
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/types/index.tsx +15 -9
- package/themes/business/src/utils/index.tsx +10 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +260 -176
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +216 -113
- package/themes/original/src/components/BusinessController/styles.tsx +1 -8
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +59 -60
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +210 -115
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +260 -109
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
- package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
- package/themes/original/src/components/Cart/index.tsx +53 -15
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +114 -118
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/FavoriteList/index.tsx +19 -0
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -73
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +20 -20
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -22
- package/themes/original/src/components/NavBar/index.tsx +15 -9
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +200 -37
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +71 -55
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +639 -664
- package/themes/original/src/components/ProductForm/styles.tsx +10 -11
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +5 -3
- package/themes/original/src/components/ServiceForm/index.tsx +410 -258
- package/themes/original/src/components/SignupForm/index.tsx +184 -127
- package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
- package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +56 -31
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +13 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +83 -29
- package/themes/original/src/utils/index.tsx +121 -10
- 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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
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
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
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
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
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={() =>
|
|
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={() =>
|
|
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
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
{
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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
|
-
|
|
865
|
-
<
|
|
866
|
-
{
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
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
|
-
|
|
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
|
-
|
|
940
|
+
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
875
941
|
/>
|
|
876
942
|
)}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
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}
|