ordering-ui-react-native 0.16.27 → 0.16.28-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 +8 -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/AddressForm/index.tsx +18 -2
- 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/OrderDetails/index.tsx +2 -20
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -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 +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- 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/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 +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OModal.tsx +40 -37
- 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/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/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +12 -0
- package/themes/original/src/components/AddressDetails/index.tsx +1 -1
- package/themes/original/src/components/AddressForm/index.tsx +139 -135
- 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 +311 -161
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +190 -113
- package/themes/original/src/components/BusinessController/styles.tsx +0 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -4
- 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 +81 -128
- 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 +49 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +293 -177
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +23 -11
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -10
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +105 -519
- package/themes/original/src/components/Cart/index.tsx +44 -12
- 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 +101 -61
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- 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/Favorite/index.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +32 -2
- 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/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 -72
- package/themes/original/src/components/LoginForm/index.tsx +83 -45
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentOption/index.tsx +1 -1
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- 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 +70 -6
- 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 +190 -35
- 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 +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- 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 +100 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +17 -12
- 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 +41 -23
- package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -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 +633 -664
- package/themes/original/src/components/ProductForm/styles.tsx +9 -8
- 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/ProfessionalFilter/index.tsx +129 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- 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 +637 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +350 -206
- 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 +199 -110
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -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 +15 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +31 -17
- package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
- package/themes/original/src/components/UserProfile/index.tsx +54 -29
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -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/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 +3 -2
- 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 +121 -30
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -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
|
|
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
|
-
|
|
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,13 +237,13 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
206
237
|
navigation.navigate('Home');
|
|
207
238
|
};
|
|
208
239
|
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
240
|
+
const handleSignUpTab = (tab: string) => {
|
|
241
|
+
setSignUpTab && setSignUpTab(tab)
|
|
242
|
+
clearErrors()
|
|
243
|
+
}
|
|
213
244
|
|
|
214
|
-
const onSubmit = (values
|
|
215
|
-
if (phoneInputData.error) {
|
|
245
|
+
const onSubmit = (values?: any) => {
|
|
246
|
+
if (phoneInputData.error && signUpTab !== 'otpEmail') {
|
|
216
247
|
showToast(ToastType.Error, phoneInputData.error);
|
|
217
248
|
return;
|
|
218
249
|
}
|
|
@@ -221,7 +252,8 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
221
252
|
!phoneInputData.phone.cellphone &&
|
|
222
253
|
((validationFields?.fields?.checkout?.cellphone?.enabled &&
|
|
223
254
|
validationFields?.fields?.checkout?.cellphone?.required) ||
|
|
224
|
-
configs?.verification_phone_required?.value === '1')
|
|
255
|
+
configs?.verification_phone_required?.value === '1') &&
|
|
256
|
+
signUpTab !== 'otpEmail'
|
|
225
257
|
) {
|
|
226
258
|
showToast(
|
|
227
259
|
ToastType.Error,
|
|
@@ -232,26 +264,29 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
232
264
|
);
|
|
233
265
|
return;
|
|
234
266
|
}
|
|
235
|
-
if (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
267
|
+
if (signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') {
|
|
268
|
+
generateOtpCode && generateOtpCode({
|
|
269
|
+
...values,
|
|
270
|
+
...((phoneInputData.phone.cellphone !== null && phoneInputData.phone.country_phone_code !== null) && { ...phoneInputData.phone }),
|
|
271
|
+
country_code: phoneInputData.phone.country_code
|
|
272
|
+
})
|
|
273
|
+
return
|
|
274
|
+
}
|
|
275
|
+
handleButtonSignupClick &&
|
|
276
|
+
handleButtonSignupClick({
|
|
277
|
+
...values,
|
|
278
|
+
...((phoneInputData.phone.cellphone !== null && phoneInputData.phone.country_phone_code !== null) && { ...phoneInputData.phone }),
|
|
279
|
+
country_code: phoneInputData.phone.country_code
|
|
280
|
+
});
|
|
281
|
+
if (!formState.loading && formState.result.result && !formState.result.error) {
|
|
282
|
+
handleSuccessSignup && handleSuccessSignup(formState.result.result);
|
|
250
283
|
}
|
|
251
|
-
setFormValues(values);
|
|
252
|
-
handleVerifyCodeClick(values);
|
|
253
284
|
};
|
|
254
285
|
|
|
286
|
+
const handleSingUpOtp = (value: string) => {
|
|
287
|
+
setOtpState && setOtpState(value)
|
|
288
|
+
}
|
|
289
|
+
|
|
255
290
|
const handleVerifyCodeClick = (values: any) => {
|
|
256
291
|
const formData = values || formValues;
|
|
257
292
|
handleSendVerifyCode &&
|
|
@@ -313,20 +348,44 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
313
348
|
|
|
314
349
|
const onRecaptchaVerify = (token: any) => {
|
|
315
350
|
setRecaptchaVerified(true)
|
|
316
|
-
handleReCaptcha(token)
|
|
351
|
+
handleReCaptcha && handleReCaptcha({ code: token, version: recaptchaConfig?.version })
|
|
317
352
|
}
|
|
318
353
|
|
|
319
354
|
useEffect(() => {
|
|
320
355
|
if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
356
|
+
if (configs?.security_recaptcha_type?.value === 'v3' &&
|
|
357
|
+
configs?.security_recaptcha_score_v3?.value > 0 &&
|
|
358
|
+
configs?.security_recaptcha_site_key_v3?.value
|
|
359
|
+
) {
|
|
360
|
+
setRecaptchaConfig({
|
|
361
|
+
version: 'v3',
|
|
362
|
+
siteKey: configs?.security_recaptcha_site_key_v3?.value || null,
|
|
363
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
364
|
+
})
|
|
365
|
+
return
|
|
366
|
+
}
|
|
367
|
+
if (configs?.security_recaptcha_site_key?.value) {
|
|
368
|
+
setRecaptchaConfig({
|
|
369
|
+
version: 'v2',
|
|
370
|
+
siteKey: configs?.security_recaptcha_site_key?.value || null,
|
|
371
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
372
|
+
})
|
|
373
|
+
}
|
|
325
374
|
}
|
|
326
375
|
}, [configs, enableReCaptcha])
|
|
327
376
|
|
|
328
377
|
useEffect(() => {
|
|
329
378
|
if (!formState.loading && formState.result?.error) {
|
|
379
|
+
if (formState.result?.result?.[0] === 'ERROR_AUTH_VERIFICATION_CODE') {
|
|
380
|
+
setRecaptchaVerified(false)
|
|
381
|
+
setRecaptchaConfig({
|
|
382
|
+
version: 'v2',
|
|
383
|
+
siteKey: configs?.security_recaptcha_site_key?.value || null,
|
|
384
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
385
|
+
})
|
|
386
|
+
showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
|
|
387
|
+
return
|
|
388
|
+
}
|
|
330
389
|
formState.result?.result &&
|
|
331
390
|
showToast(ToastType.Error, formState.result?.result[0]);
|
|
332
391
|
setIsLoadingVerifyModal(false);
|
|
@@ -337,15 +396,19 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
337
396
|
if (Object.keys(errors).length > 0) {
|
|
338
397
|
setIsLoadingVerifyModal(false);
|
|
339
398
|
}
|
|
340
|
-
}, [errors])
|
|
399
|
+
}, [errors])
|
|
341
400
|
|
|
342
401
|
useEffect(() => {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
402
|
+
if (signUpTab === 'default' || signUpTab === 'otpCellphone') {
|
|
403
|
+
register('cellphone', {
|
|
404
|
+
required: isRequiredField('cellphone')
|
|
405
|
+
? t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required').replace('_attribute_', t('CELLPHONE', 'Cellphone'))
|
|
406
|
+
: null
|
|
407
|
+
})
|
|
408
|
+
} else {
|
|
409
|
+
unregister('cellphone')
|
|
410
|
+
}
|
|
411
|
+
}, [signUpTab])
|
|
349
412
|
|
|
350
413
|
useEffect(() => {
|
|
351
414
|
if (phoneInputData?.phone?.cellphone) setValue('cellphone', phoneInputData?.phone?.cellphone, '')
|
|
@@ -382,6 +445,16 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
382
445
|
})
|
|
383
446
|
}, [configs])
|
|
384
447
|
|
|
448
|
+
useEffect(() => {
|
|
449
|
+
if (checkPhoneCodeState?.result?.error) {
|
|
450
|
+
setAlertState({
|
|
451
|
+
open: true,
|
|
452
|
+
title: (typeof checkPhoneCodeState?.result?.result === 'string' ? checkPhoneCodeState?.result?.result : checkPhoneCodeState?.result?.result[0].toString()) || t('ERROR', 'Error'),
|
|
453
|
+
content: []
|
|
454
|
+
})
|
|
455
|
+
}
|
|
456
|
+
}, [checkPhoneCodeState])
|
|
457
|
+
|
|
385
458
|
return (
|
|
386
459
|
<View>
|
|
387
460
|
<NavBar
|
|
@@ -395,47 +468,92 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
395
468
|
titleStyle={{ marginLeft: 0, marginRight: 0 }}
|
|
396
469
|
/>
|
|
397
470
|
<FormSide>
|
|
398
|
-
{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
471
|
+
{((Number(useSignUpFullDetails) + Number(useSignUpOtpEmail) + Number(useSignUpOtpCellphone)) > 1) && (
|
|
472
|
+
<SignupWith>
|
|
473
|
+
<OTabs
|
|
474
|
+
horizontal
|
|
475
|
+
showsHorizontalScrollIndicator={false}
|
|
476
|
+
ref={tabsRef}
|
|
477
|
+
>
|
|
478
|
+
{useSignUpFullDetails && (
|
|
479
|
+
<TabBtn
|
|
480
|
+
onPress={() => handleSignUpTab('default')}
|
|
481
|
+
onLayout={(event: any) => handleOnLayout(event, 'default')}
|
|
482
|
+
>
|
|
483
|
+
<OTab
|
|
484
|
+
style={{
|
|
485
|
+
borderBottomColor:
|
|
486
|
+
signUpTab === 'default'
|
|
487
|
+
? theme.colors.textNormal
|
|
488
|
+
: theme.colors.border,
|
|
489
|
+
}}>
|
|
490
|
+
<OText
|
|
491
|
+
size={14}
|
|
492
|
+
color={
|
|
493
|
+
signUpTab === 'default'
|
|
494
|
+
? theme.colors.textNormal
|
|
495
|
+
: theme.colors.disabled
|
|
496
|
+
}
|
|
497
|
+
weight={signUpTab === 'default' ? 'bold' : 'normal'}>
|
|
498
|
+
{t('DEFAULT', 'Default')}
|
|
499
|
+
</OText>
|
|
500
|
+
</OTab>
|
|
501
|
+
</TabBtn>
|
|
502
|
+
)}
|
|
503
|
+
{useSignUpOtpEmail && (
|
|
504
|
+
<TabBtn
|
|
505
|
+
onPress={() => handleSignUpTab('otpEmail')}
|
|
506
|
+
onLayout={(event: any) => handleOnLayout(event, 'otpEmail')}
|
|
507
|
+
>
|
|
508
|
+
<OTab
|
|
509
|
+
style={{
|
|
510
|
+
borderBottomColor:
|
|
511
|
+
signUpTab === 'otpEmail'
|
|
512
|
+
? theme.colors.textNormal
|
|
513
|
+
: theme.colors.border,
|
|
514
|
+
}}>
|
|
515
|
+
<OText
|
|
516
|
+
size={14}
|
|
517
|
+
color={
|
|
518
|
+
signUpTab === 'otpEmail'
|
|
519
|
+
? theme.colors.textNormal
|
|
520
|
+
: theme.colors.disabled
|
|
521
|
+
}
|
|
522
|
+
weight={signUpTab === 'otpEmail' ? 'bold' : 'normal'}>
|
|
523
|
+
{t('BY_OTP_EMAIL', 'by Otp Email')}
|
|
524
|
+
</OText>
|
|
525
|
+
</OTab>
|
|
526
|
+
</TabBtn>
|
|
527
|
+
|
|
528
|
+
)}
|
|
529
|
+
{useSignUpOtpCellphone && (
|
|
530
|
+
<TabBtn
|
|
531
|
+
onPress={() => handleSignUpTab('otpCellphone')}
|
|
532
|
+
onLayout={(event: any) => handleOnLayout(event, 'otpCellphone')}
|
|
533
|
+
>
|
|
534
|
+
<OTab
|
|
535
|
+
style={{
|
|
536
|
+
borderBottomColor:
|
|
537
|
+
signUpTab === 'otpCellphone'
|
|
538
|
+
? theme.colors.textNormal
|
|
539
|
+
: theme.colors.border,
|
|
540
|
+
}}>
|
|
541
|
+
<OText
|
|
542
|
+
size={14}
|
|
543
|
+
color={
|
|
544
|
+
signUpTab === 'otpCellphone'
|
|
545
|
+
? theme.colors.textNormal
|
|
546
|
+
: theme.colors.disabled
|
|
547
|
+
}
|
|
548
|
+
weight={signUpTab === 'otpCellphone' ? 'bold' : 'normal'}>
|
|
549
|
+
{t('BY_OTP_CELLPHONE', 'by Otp Cellphone')}
|
|
550
|
+
</OText>
|
|
551
|
+
</OTab>
|
|
552
|
+
</TabBtn>
|
|
553
|
+
)}
|
|
554
|
+
</OTabs>
|
|
555
|
+
</SignupWith>
|
|
556
|
+
)}
|
|
439
557
|
<FormInput>
|
|
440
558
|
{!(useChekoutFileds && validationFields?.loading) ? (
|
|
441
559
|
<>
|
|
@@ -445,7 +563,9 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
445
563
|
(field: any, i: number) =>
|
|
446
564
|
!notValidationFields.includes(field.code) &&
|
|
447
565
|
showField &&
|
|
448
|
-
showField(field.code) &&
|
|
566
|
+
showField(field.code) &&
|
|
567
|
+
(signUpTab === 'default' ||
|
|
568
|
+
(signUpTab === 'otpEmail' && field.code === 'email')) && (
|
|
449
569
|
<React.Fragment key={field.id}>
|
|
450
570
|
{errors?.[`${field.code}`] && (
|
|
451
571
|
<OText
|
|
@@ -469,7 +589,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
469
589
|
value={value}
|
|
470
590
|
onChange={(val: any) =>
|
|
471
591
|
field.code !== 'email'
|
|
472
|
-
? onChange(val)
|
|
592
|
+
? (onChange(val))
|
|
473
593
|
: handleChangeInputEmail(val, onChange)
|
|
474
594
|
}
|
|
475
595
|
autoCapitalize={
|
|
@@ -501,7 +621,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
501
621
|
),
|
|
502
622
|
)}
|
|
503
623
|
|
|
504
|
-
{!!showInputPhoneNumber && (
|
|
624
|
+
{(!!showInputPhoneNumber && (signUpTab === 'default' || signUpTab === 'otpCellphone')) && (
|
|
505
625
|
<View style={{ marginBottom: 25 }}>
|
|
506
626
|
<PhoneInputNumber
|
|
507
627
|
data={phoneInputData}
|
|
@@ -515,7 +635,6 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
515
635
|
}
|
|
516
636
|
})}
|
|
517
637
|
forwardRef={phoneRef}
|
|
518
|
-
defaultCode={formState?.country_code ?? formState?.country_phone_code ?? null}
|
|
519
638
|
changeCountry={(val: any) => setPhoneInputData({
|
|
520
639
|
...phoneInputData,
|
|
521
640
|
phone: {
|
|
@@ -532,66 +651,79 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
532
651
|
</View>
|
|
533
652
|
)}
|
|
534
653
|
|
|
535
|
-
{enableReCaptcha && (
|
|
654
|
+
{(enableReCaptcha && recaptchaConfig?.version) && (
|
|
536
655
|
<>
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
{
|
|
543
|
-
|
|
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}
|
|
656
|
+
{recaptchaConfig?.version === 'v3' ? (
|
|
657
|
+
<ReCaptcha
|
|
658
|
+
url={recaptchaConfig?.baseUrl}
|
|
659
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
660
|
+
containerStyle={{ height: 40 }}
|
|
661
|
+
onExecute={onRecaptchaVerify}
|
|
662
|
+
reCaptchaType={1}
|
|
587
663
|
/>
|
|
664
|
+
) : (
|
|
665
|
+
<>
|
|
666
|
+
<TouchableOpacity
|
|
667
|
+
onPress={handleOpenRecaptcha}
|
|
668
|
+
style={{ marginHorizontal: 4, marginBottom: 10 }}
|
|
669
|
+
>
|
|
670
|
+
<RecaptchaButton>
|
|
671
|
+
{recaptchaVerified ? (
|
|
672
|
+
<MaterialCommunityIcons
|
|
673
|
+
name="checkbox-marked"
|
|
674
|
+
size={23}
|
|
675
|
+
color={theme.colors.primary}
|
|
676
|
+
/>
|
|
677
|
+
) : (
|
|
678
|
+
<MaterialCommunityIcons
|
|
679
|
+
name="checkbox-blank-outline"
|
|
680
|
+
size={23}
|
|
681
|
+
color={theme.colors.disabled}
|
|
682
|
+
/>
|
|
683
|
+
)}
|
|
684
|
+
<OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
|
|
685
|
+
</RecaptchaButton>
|
|
686
|
+
</TouchableOpacity>
|
|
687
|
+
<Recaptcha
|
|
688
|
+
ref={recaptchaRef}
|
|
689
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
690
|
+
baseUrl={recaptchaConfig?.baseUrl}
|
|
691
|
+
onVerify={onRecaptchaVerify}
|
|
692
|
+
onExpire={() => setRecaptchaVerified(false)}
|
|
693
|
+
/>
|
|
694
|
+
</>
|
|
588
695
|
)}
|
|
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
696
|
|
|
697
|
+
</>
|
|
698
|
+
)}
|
|
699
|
+
{(signUpTab === 'default') && (
|
|
700
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20 }}>
|
|
701
|
+
<Controller
|
|
702
|
+
control={control}
|
|
703
|
+
render={({ onChange, value }: any) => (
|
|
704
|
+
<CheckBox
|
|
705
|
+
value={value}
|
|
706
|
+
onValueChange={newValue => {
|
|
707
|
+
onChange(newValue)
|
|
708
|
+
handleChangePromotions()
|
|
709
|
+
}}
|
|
710
|
+
boxType={'square'}
|
|
711
|
+
tintColors={{
|
|
712
|
+
true: theme.colors.primary,
|
|
713
|
+
false: theme.colors.disabled
|
|
714
|
+
}}
|
|
715
|
+
tintColor={theme.colors.disabled}
|
|
716
|
+
onCheckColor={theme.colors.primary}
|
|
717
|
+
onTintColor={theme.colors.primary}
|
|
718
|
+
style={Platform.OS === 'ios' && style.checkBoxStyle}
|
|
719
|
+
/>
|
|
720
|
+
)}
|
|
721
|
+
name='promotions'
|
|
722
|
+
defaultValue={false}
|
|
723
|
+
/>
|
|
724
|
+
<OText style={{ fontSize: 14, paddingHorizontal: 5 }}>{t('RECEIVE_NEWS_EXCLUSIVE_PROMOTIONS', 'Receive newsletters and exclusive promotions')}</OText>
|
|
725
|
+
</View>
|
|
726
|
+
)}
|
|
595
727
|
{configs?.terms_and_conditions?.value === 'true' && (
|
|
596
728
|
<>
|
|
597
729
|
{errors?.termsAccept && (
|
|
@@ -643,7 +775,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
643
775
|
|
|
644
776
|
)}
|
|
645
777
|
|
|
646
|
-
{
|
|
778
|
+
{signUpTab === 'default' && (
|
|
647
779
|
<>
|
|
648
780
|
{errors?.password && (
|
|
649
781
|
<OText
|
|
@@ -715,9 +847,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
715
847
|
<Spinner visible />
|
|
716
848
|
)}
|
|
717
849
|
|
|
718
|
-
{
|
|
719
|
-
useSignupByEmail &&
|
|
720
|
-
useSignupByCellphone ? (
|
|
850
|
+
{(signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') ? (
|
|
721
851
|
<OButton
|
|
722
852
|
onClick={handleSubmit(onSubmit)}
|
|
723
853
|
text={t('GET_VERIFY_CODE', 'Get Verify Code')}
|
|
@@ -756,86 +886,100 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
756
886
|
</View>
|
|
757
887
|
)
|
|
758
888
|
}
|
|
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
889
|
{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))
|
|
890
|
+
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
|
|
891
|
+
((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
|
|
892
|
+
((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
|
|
781
893
|
(
|
|
782
|
-
|
|
783
|
-
<
|
|
784
|
-
{
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
894
|
+
<>
|
|
895
|
+
<View
|
|
896
|
+
style={{
|
|
897
|
+
flexDirection: 'row',
|
|
898
|
+
width: '100%',
|
|
899
|
+
justifyContent: 'space-between',
|
|
900
|
+
alignItems: 'center',
|
|
901
|
+
marginVertical: 30,
|
|
902
|
+
}}>
|
|
903
|
+
<View style={style.line} />
|
|
904
|
+
<OText
|
|
905
|
+
size={14}
|
|
906
|
+
mBottom={10}
|
|
907
|
+
style={{ paddingHorizontal: 19 }}
|
|
908
|
+
color={theme.colors.disabled}>
|
|
909
|
+
{t('OR', 'or')}
|
|
910
|
+
</OText>
|
|
911
|
+
<View style={style.line} />
|
|
912
|
+
</View>
|
|
913
|
+
<ButtonsWrapper>
|
|
914
|
+
<SocialButtons>
|
|
915
|
+
{(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
|
|
916
|
+
configs?.facebook_id?.value &&
|
|
917
|
+
facebookLoginEnabled &&
|
|
918
|
+
(
|
|
919
|
+
<FacebookLogin
|
|
920
|
+
notificationState={notificationState}
|
|
921
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
922
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
923
|
+
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
924
|
+
/>
|
|
925
|
+
)}
|
|
926
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
927
|
+
<GoogleLogin
|
|
789
928
|
notificationState={notificationState}
|
|
929
|
+
webClientId={configs?.google_login_client_id?.value}
|
|
790
930
|
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
791
931
|
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
792
|
-
|
|
932
|
+
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
793
933
|
/>
|
|
794
934
|
)}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
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>
|
|
935
|
+
{(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
|
|
936
|
+
<AppleLogin
|
|
937
|
+
notificationState={notificationState}
|
|
938
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
939
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
940
|
+
handleSuccessAppleLogin={handleSuccessFacebook}
|
|
941
|
+
/>
|
|
942
|
+
)}
|
|
943
|
+
</SocialButtons>
|
|
944
|
+
</ButtonsWrapper>
|
|
945
|
+
</>
|
|
814
946
|
)
|
|
815
947
|
)}
|
|
816
|
-
|
|
817
948
|
</FormSide>
|
|
818
|
-
<OModal
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
949
|
+
<OModal
|
|
950
|
+
open={willVerifyOtpState}
|
|
951
|
+
onClose={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
|
|
952
|
+
entireModal
|
|
953
|
+
title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
|
|
954
|
+
>
|
|
955
|
+
<Otp
|
|
956
|
+
pinCount={numOtpInputs || 6}
|
|
957
|
+
willVerifyOtpState={willVerifyOtpState || false}
|
|
958
|
+
setWillVerifyOtpState={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
|
|
959
|
+
handleLoginOtp={handleSingUpOtp}
|
|
960
|
+
onSubmit={onSubmit}
|
|
961
|
+
setAlertState={setAlertState}
|
|
827
962
|
/>
|
|
828
963
|
</OModal>
|
|
829
964
|
<Spinner
|
|
830
965
|
visible={formState.loading || validationFields.loading || isFBLoading}
|
|
831
966
|
/>
|
|
967
|
+
<Alert
|
|
968
|
+
open={alertState.open}
|
|
969
|
+
content={alertState.content}
|
|
970
|
+
title={alertState.title || ''}
|
|
971
|
+
onAccept={closeAlert}
|
|
972
|
+
onClose={closeAlert}
|
|
973
|
+
/>
|
|
832
974
|
</View>
|
|
833
975
|
);
|
|
834
976
|
};
|
|
835
977
|
|
|
836
978
|
export const SignupForm = (props: any) => {
|
|
979
|
+
const _numOtpInputs = 6
|
|
837
980
|
const signupProps = {
|
|
838
981
|
...props,
|
|
982
|
+
numOtpInputs: _numOtpInputs,
|
|
839
983
|
isRecaptchaEnable: true,
|
|
840
984
|
UIComponent: SignupFormUI,
|
|
841
985
|
};
|