ordering-ui-react-native 0.17.49 → 0.17.50-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 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +125 -113
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +238 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
- package/themes/business/src/components/OrderDetails/Delivery.tsx +30 -4
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrderSummary/index.tsx +113 -121
- package/themes/business/src/components/OrdersOption/index.tsx +32 -75
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +29 -14
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +32 -2
- package/themes/business/src/utils/index.tsx +44 -1
- 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/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- 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/PhoneInputNumber/index.tsx +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +79 -44
- package/themes/original/src/components/AddressList/index.tsx +27 -22
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +160 -91
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
- package/themes/original/src/components/BusinessController/index.tsx +146 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -2
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
- package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
- package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
- package/themes/original/src/components/BusinessProductsList/index.tsx +23 -14
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +669 -513
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -79
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -11
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +100 -67
- package/themes/original/src/components/CartContent/index.tsx +115 -19
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +366 -173
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- 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/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -9
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +51 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +15 -4
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +64 -26
- package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +77 -52
- package/themes/original/src/components/NavBar/index.tsx +18 -18
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +46 -50
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
- package/themes/original/src/components/OrderDetails/index.tsx +190 -358
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +93 -114
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +85 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +76 -66
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/ProductForm/index.tsx +114 -36
- package/themes/original/src/components/ProductForm/styles.tsx +5 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +17 -14
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +66 -17
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -20
- package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -34
- package/themes/original/src/components/SingleProductCard/styles.tsx +22 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +67 -34
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +12 -29
- package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +67 -24
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +16 -2
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +40 -11
- package/themes/original/src/utils/index.tsx +375 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, ScrollView, Dimensions, Pressable } from 'react-native';
|
|
3
3
|
import { useForm, Controller } from 'react-hook-form';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
@@ -17,15 +17,20 @@ import {
|
|
|
17
17
|
} from 'ordering-components/native';
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
|
+
LoginWith,
|
|
21
|
+
TabsContainer,
|
|
20
22
|
WelcomeTextContainer,
|
|
21
23
|
LogoWrapper,
|
|
22
|
-
RecaptchaButton
|
|
24
|
+
RecaptchaButton,
|
|
23
25
|
} from './styles';
|
|
24
26
|
|
|
25
|
-
import { OText, OButton, OInput, OIcon } from '../shared';
|
|
27
|
+
import { OText, OButton, OInput, OIcon, OModal } from '../shared';
|
|
26
28
|
import { LoginParams } from '../../types';
|
|
27
29
|
import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
|
|
28
30
|
import { _setStoreData } from '../../../../../src/providers/StoreUtil'
|
|
31
|
+
import { Otp } from './Otp'
|
|
32
|
+
import Alert from '../../../../../src/providers/AlertProvider'
|
|
33
|
+
import { PhoneInputNumber } from '../PhoneInputNumber'
|
|
29
34
|
|
|
30
35
|
const LoginFormUI = (props: LoginParams) => {
|
|
31
36
|
const {
|
|
@@ -34,7 +39,16 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
34
39
|
handleButtonLoginClick,
|
|
35
40
|
useRootPoint,
|
|
36
41
|
handleReCaptcha,
|
|
37
|
-
enableReCaptcha
|
|
42
|
+
enableReCaptcha,
|
|
43
|
+
checkPhoneCodeState,
|
|
44
|
+
useLoginByCellphone,
|
|
45
|
+
useLoginByEmail,
|
|
46
|
+
loginTab,
|
|
47
|
+
otpType,
|
|
48
|
+
setOtpType,
|
|
49
|
+
generateOtpCode,
|
|
50
|
+
useLoginOtpEmail,
|
|
51
|
+
useLoginOtpCellphone,
|
|
38
52
|
} = props;
|
|
39
53
|
|
|
40
54
|
const theme = useTheme()
|
|
@@ -45,17 +59,63 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
45
59
|
const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
|
|
46
60
|
const [recaptchaVerified, setRecaptchaVerified] = useState(false)
|
|
47
61
|
const recaptchaRef = useRef<any>({});
|
|
48
|
-
const { control, handleSubmit, formState: { errors } } = useForm();
|
|
62
|
+
const { control, handleSubmit, formState: { errors }, clearErrors } = useForm();
|
|
49
63
|
const [orientationState] = useDeviceOrientation();
|
|
50
64
|
|
|
51
65
|
const [formsStateValues, setFormsStateValues] = useState<any>({ isSubmitted: false })
|
|
52
66
|
|
|
67
|
+
const scrollRefTab = useRef() as React.MutableRefObject<ScrollView>;
|
|
68
|
+
const inputRef = useRef<any>(null);
|
|
69
|
+
const [windowWidth, setWindowWidth] = useState(
|
|
70
|
+
parseInt(parseFloat(String(Dimensions.get('window').width)).toFixed(0)),
|
|
71
|
+
);
|
|
72
|
+
const [projectName, setProjectName] = useState('');
|
|
73
|
+
const [isLoadingVerifyModal, setIsLoadingVerifyModal] = useState(false);
|
|
74
|
+
const [willVerifyOtpState, setWillVerifyOtpState] = useState(false)
|
|
75
|
+
const [alertState, setAlertState] = useState({ open: false, title: '', content: [] })
|
|
76
|
+
const [phoneInputData, setPhoneInputData] = useState({
|
|
77
|
+
error: '',
|
|
78
|
+
phone: {
|
|
79
|
+
country_phone_code: null,
|
|
80
|
+
cellphone: null,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const isOtpEmail = loginTab === 'otp' && otpType === 'email'
|
|
85
|
+
const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
|
|
86
|
+
|
|
87
|
+
const mainLogin = (values) => {
|
|
88
|
+
if (loginTab === 'otp') {
|
|
89
|
+
if (phoneInputData.error && (loginTab !== 'otp' || (otpType === 'cellphone' && loginTab === 'otp'))) {
|
|
90
|
+
showToast(ToastType.Error, t('INVALID_PHONE_NUMBER', 'Invalid phone number'));
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
if (loginTab === 'otp') {
|
|
94
|
+
generateOtpCode({
|
|
95
|
+
...values,
|
|
96
|
+
...phoneInputData.phone
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
setWillVerifyOtpState(true)
|
|
100
|
+
} else {
|
|
101
|
+
if (phoneInputData.error) {
|
|
102
|
+
showToast(ToastType.Error, phoneInputData.error);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
handleButtonLoginClick({
|
|
106
|
+
...values,
|
|
107
|
+
...phoneInputData.phone,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
53
112
|
const onSubmit = (values: any) => {
|
|
113
|
+
if (phoneInputData.error) {
|
|
114
|
+
showToast(ToastType.Error, phoneInputData.error);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
54
118
|
if (values?.project_name) {
|
|
55
|
-
setOrdering({
|
|
56
|
-
...ordering,
|
|
57
|
-
project: values?.project_name
|
|
58
|
-
})
|
|
59
119
|
_setStoreData('project_name', values?.project_name)
|
|
60
120
|
setFormsStateValues({
|
|
61
121
|
...formsStateValues,
|
|
@@ -65,7 +125,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
65
125
|
return
|
|
66
126
|
}
|
|
67
127
|
|
|
68
|
-
|
|
128
|
+
mainLogin(values)
|
|
69
129
|
};
|
|
70
130
|
|
|
71
131
|
const handleChangeInputEmail = (value: string, onChange: any) => {
|
|
@@ -110,10 +170,52 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
110
170
|
},
|
|
111
171
|
forgotStyle: {
|
|
112
172
|
textAlign: 'center',
|
|
113
|
-
fontWeight: '
|
|
173
|
+
fontWeight: '600',
|
|
114
174
|
color: theme.colors.skyBlue,
|
|
115
175
|
marginTop: orientationState?.dimensions?.height * 0.03,
|
|
116
|
-
}
|
|
176
|
+
},
|
|
177
|
+
btn: {
|
|
178
|
+
borderRadius: 7.6,
|
|
179
|
+
height: 44,
|
|
180
|
+
},
|
|
181
|
+
btnTab: {
|
|
182
|
+
flex: 1,
|
|
183
|
+
minWidth: 88,
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
},
|
|
186
|
+
btnTabText: {
|
|
187
|
+
fontFamily: 'Poppins',
|
|
188
|
+
fontStyle: 'normal',
|
|
189
|
+
fontSize: 16,
|
|
190
|
+
marginBottom: 10,
|
|
191
|
+
paddingLeft: 8,
|
|
192
|
+
paddingRight: 8,
|
|
193
|
+
},
|
|
194
|
+
btnFlag: {
|
|
195
|
+
width: 79,
|
|
196
|
+
borderWidth: 1,
|
|
197
|
+
borderRadius: 7.6,
|
|
198
|
+
marginRight: 9,
|
|
199
|
+
borderColor: theme.colors.inputSignup,
|
|
200
|
+
},
|
|
201
|
+
borderStyleBase: {
|
|
202
|
+
width: 30,
|
|
203
|
+
height: 45
|
|
204
|
+
},
|
|
205
|
+
borderStyleHighLighted: {
|
|
206
|
+
borderColor: "#03DAC6",
|
|
207
|
+
},
|
|
208
|
+
underlineStyleBase: {
|
|
209
|
+
width: 45,
|
|
210
|
+
height: 60,
|
|
211
|
+
borderWidth: 1,
|
|
212
|
+
fontSize: 16
|
|
213
|
+
},
|
|
214
|
+
underlineStyleHighLighted: {
|
|
215
|
+
borderColor: theme.colors.primary,
|
|
216
|
+
color: theme.colors.primary,
|
|
217
|
+
fontSize: 16
|
|
218
|
+
},
|
|
117
219
|
});
|
|
118
220
|
|
|
119
221
|
useEffect(() => {
|
|
@@ -151,7 +253,11 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
151
253
|
if (values?.project_name) {
|
|
152
254
|
delete values.project_name
|
|
153
255
|
}
|
|
154
|
-
|
|
256
|
+
mainLogin(values)
|
|
257
|
+
setFormsStateValues({
|
|
258
|
+
...formsStateValues,
|
|
259
|
+
isSubmitted: false,
|
|
260
|
+
})
|
|
155
261
|
}, [ordering, formsStateValues.isSubmitted])
|
|
156
262
|
|
|
157
263
|
|
|
@@ -190,149 +296,66 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
190
296
|
}
|
|
191
297
|
}, [configs, enableReCaptcha])
|
|
192
298
|
|
|
299
|
+
const handleChangeTab = (val: string) => {
|
|
300
|
+
setPhoneInputData({ ...phoneInputData, error: '' });
|
|
301
|
+
clearErrors([val]);
|
|
302
|
+
props.handleChangeTab(val);
|
|
303
|
+
|
|
304
|
+
if (loginTab === 'email') {
|
|
305
|
+
scrollRefTab.current?.scrollToEnd({ animated: true });
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (loginTab === 'cellphone') {
|
|
309
|
+
scrollRefTab.current?.scrollTo({ animated: true });
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const handleChangeOtpType = (type: string) => {
|
|
314
|
+
handleChangeTab('otp', type)
|
|
315
|
+
setOtpType(type)
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const handleLoginOtp = (code: string) => {
|
|
319
|
+
handleButtonLoginClick({ code })
|
|
320
|
+
setWillVerifyOtpState(false)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const closeAlert = () => {
|
|
324
|
+
setAlertState({
|
|
325
|
+
open: false,
|
|
326
|
+
title: '',
|
|
327
|
+
content: []
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
if (checkPhoneCodeState?.result?.error) {
|
|
333
|
+
setAlertState({
|
|
334
|
+
open: true,
|
|
335
|
+
content: t(checkPhoneCodeState?.result?.error, checkPhoneCodeState?.result?.error),
|
|
336
|
+
title: ''
|
|
337
|
+
})
|
|
338
|
+
}
|
|
339
|
+
}, [checkPhoneCodeState])
|
|
340
|
+
|
|
341
|
+
useEffect(() => {
|
|
342
|
+
const projectInputTimeout = setTimeout(() => {
|
|
343
|
+
if (projectName && useRootPoint) {
|
|
344
|
+
setOrdering({
|
|
345
|
+
...ordering,
|
|
346
|
+
project: projectName
|
|
347
|
+
})
|
|
348
|
+
}
|
|
349
|
+
}, 1500)
|
|
350
|
+
return () => clearTimeout(projectInputTimeout);
|
|
351
|
+
}, [projectName])
|
|
352
|
+
|
|
193
353
|
const logo = (
|
|
194
354
|
<LogoWrapper>
|
|
195
355
|
<OIcon src={theme.images.logos.logotype} style={styles.logo} />
|
|
196
356
|
</LogoWrapper>
|
|
197
357
|
);
|
|
198
358
|
|
|
199
|
-
const InputControllers = (
|
|
200
|
-
<>
|
|
201
|
-
{useRootPoint && (
|
|
202
|
-
<Controller
|
|
203
|
-
control={control}
|
|
204
|
-
name='project_name'
|
|
205
|
-
rules={{ required: t(`VALIDATION_ERROR_PROJECT_NAME_REQUIRED`, 'The field project name is required') }}
|
|
206
|
-
defaultValue=""
|
|
207
|
-
render={({ onChange, value }: any) => (
|
|
208
|
-
<OInput
|
|
209
|
-
name='project_name'
|
|
210
|
-
placeholder={t('PROJECT_NAME', 'Project Name')}
|
|
211
|
-
style={styles.inputStyle}
|
|
212
|
-
value={value}
|
|
213
|
-
autoCapitalize='none'
|
|
214
|
-
autoCorrect={false}
|
|
215
|
-
inputStyle={{ textAlign: 'center' }}
|
|
216
|
-
onChange={(e: any) => {
|
|
217
|
-
onChange(e?.target?.value);
|
|
218
|
-
setFormsStateValues({
|
|
219
|
-
...formsStateValues,
|
|
220
|
-
isSubmitted: false,
|
|
221
|
-
})
|
|
222
|
-
}}
|
|
223
|
-
/>
|
|
224
|
-
)}
|
|
225
|
-
/>
|
|
226
|
-
)}
|
|
227
|
-
|
|
228
|
-
<Controller
|
|
229
|
-
control={control}
|
|
230
|
-
render={({ onChange, value }: any) => (
|
|
231
|
-
<OInput
|
|
232
|
-
placeholder={t('USER', 'User')}
|
|
233
|
-
style={styles.inputStyle}
|
|
234
|
-
value={value}
|
|
235
|
-
autoCapitalize="none"
|
|
236
|
-
autoCorrect={false}
|
|
237
|
-
type="email-address"
|
|
238
|
-
inputStyle={{ textAlign: 'center' }}
|
|
239
|
-
onChange={(e: any) => {
|
|
240
|
-
handleChangeInputEmail(e, onChange);
|
|
241
|
-
}}
|
|
242
|
-
/>
|
|
243
|
-
)}
|
|
244
|
-
name="email"
|
|
245
|
-
rules={{
|
|
246
|
-
required: t(
|
|
247
|
-
'VALIDATION_ERROR_EMAIL_REQUIRED',
|
|
248
|
-
'The field Email is required',
|
|
249
|
-
).replace('_attribute_', t('EMAIL', 'Email')),
|
|
250
|
-
pattern: {
|
|
251
|
-
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
252
|
-
message: t(
|
|
253
|
-
'INVALID_ERROR_EMAIL',
|
|
254
|
-
'Invalid email address',
|
|
255
|
-
).replace('_attribute_', t('EMAIL', 'Email')),
|
|
256
|
-
},
|
|
257
|
-
}}
|
|
258
|
-
defaultValue=""
|
|
259
|
-
/>
|
|
260
|
-
|
|
261
|
-
<Controller
|
|
262
|
-
control={control}
|
|
263
|
-
render={({ onChange, value }: any) => (
|
|
264
|
-
<OInput
|
|
265
|
-
isSecured={true}
|
|
266
|
-
placeholder={t('PASSWORD', 'Password')}
|
|
267
|
-
style={styles.inputStyle}
|
|
268
|
-
value={value}
|
|
269
|
-
onChange={(val: any) => onChange(val)}
|
|
270
|
-
inputStyle={{ textAlign: 'center' }}
|
|
271
|
-
/>
|
|
272
|
-
)}
|
|
273
|
-
name="password"
|
|
274
|
-
rules={{
|
|
275
|
-
required: t(
|
|
276
|
-
'VALIDATION_ERROR_PASSWORD_REQUIRED',
|
|
277
|
-
'The field Password is required',
|
|
278
|
-
).replace('_attribute_', t('PASSWORD', 'Password')),
|
|
279
|
-
}}
|
|
280
|
-
defaultValue=""
|
|
281
|
-
/>
|
|
282
|
-
{(recaptchaConfig?.version) && (
|
|
283
|
-
<>
|
|
284
|
-
{recaptchaConfig?.version === 'v3' ? (
|
|
285
|
-
<ReCaptcha
|
|
286
|
-
url={recaptchaConfig?.baseUrl}
|
|
287
|
-
siteKey={recaptchaConfig?.siteKey}
|
|
288
|
-
containerStyle={{ height: 40 }}
|
|
289
|
-
onExecute={onRecaptchaVerify}
|
|
290
|
-
reCaptchaType={1}
|
|
291
|
-
/>
|
|
292
|
-
) : (
|
|
293
|
-
<>
|
|
294
|
-
<TouchableOpacity
|
|
295
|
-
onPress={handleOpenRecaptcha}
|
|
296
|
-
>
|
|
297
|
-
<RecaptchaButton>
|
|
298
|
-
{recaptchaVerified ? (
|
|
299
|
-
<MaterialCommunityIcons
|
|
300
|
-
name="checkbox-marked"
|
|
301
|
-
size={26}
|
|
302
|
-
color={theme.colors.primary}
|
|
303
|
-
/>
|
|
304
|
-
) : (
|
|
305
|
-
<MaterialCommunityIcons
|
|
306
|
-
name="checkbox-blank-outline"
|
|
307
|
-
size={26}
|
|
308
|
-
color={theme.colors.mediumGray}
|
|
309
|
-
/>
|
|
310
|
-
)}
|
|
311
|
-
<OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
|
|
312
|
-
</RecaptchaButton>
|
|
313
|
-
</TouchableOpacity>
|
|
314
|
-
<Recaptcha
|
|
315
|
-
ref={recaptchaRef}
|
|
316
|
-
siteKey={recaptchaConfig?.siteKey}
|
|
317
|
-
baseUrl={recaptchaConfig?.baseUrl}
|
|
318
|
-
onVerify={onRecaptchaVerify}
|
|
319
|
-
onExpire={() => setRecaptchaVerified(false)}
|
|
320
|
-
/>
|
|
321
|
-
</>)
|
|
322
|
-
}
|
|
323
|
-
</>
|
|
324
|
-
)}
|
|
325
|
-
<OButton
|
|
326
|
-
onClick={handleSubmit(onSubmit)}
|
|
327
|
-
text={loginButtonText}
|
|
328
|
-
imgRightSrc={null}
|
|
329
|
-
isLoading={formState.loading}
|
|
330
|
-
style={{ borderRadius: 0 }}
|
|
331
|
-
textStyle={{ fontSize: 24 }}
|
|
332
|
-
/>
|
|
333
|
-
</>
|
|
334
|
-
);
|
|
335
|
-
|
|
336
359
|
const welcome = (
|
|
337
360
|
<WelcomeTextContainer>
|
|
338
361
|
<OText
|
|
@@ -357,12 +380,14 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
357
380
|
);
|
|
358
381
|
|
|
359
382
|
const note = (
|
|
360
|
-
|
|
361
|
-
{
|
|
362
|
-
|
|
363
|
-
{
|
|
383
|
+
useRootPoint && (
|
|
384
|
+
<OText size={24} mBottom={18}>
|
|
385
|
+
{t('IF_NOT_HAVE_ACCOUNT', 'If you don\'t have and account, please contact Ordering')}
|
|
386
|
+
<OText size={24} mBottom={18} color={theme.colors.skyBlue}>
|
|
387
|
+
{t('SUPPORT_DEPARTMENT', 'support department')}
|
|
388
|
+
</OText>
|
|
364
389
|
</OText>
|
|
365
|
-
|
|
390
|
+
)
|
|
366
391
|
)
|
|
367
392
|
|
|
368
393
|
return (
|
|
@@ -416,8 +441,286 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
416
441
|
{logo}
|
|
417
442
|
</View>
|
|
418
443
|
)}
|
|
419
|
-
|
|
444
|
+
|
|
445
|
+
{(Number(useLoginByEmail) + Number(useLoginOtpEmail) + Number(useLoginOtpCellphone) > 1) && (
|
|
446
|
+
<LoginWith>
|
|
447
|
+
<ScrollView
|
|
448
|
+
ref={scrollRefTab}
|
|
449
|
+
showsVerticalScrollIndicator={false}
|
|
450
|
+
showsHorizontalScrollIndicator={false}
|
|
451
|
+
horizontal
|
|
452
|
+
style={{
|
|
453
|
+
width: orientationState?.orientation === LANDSCAPE ? orientationState?.dimensions?.width * 0.4 : windowWidth - 42
|
|
454
|
+
}}
|
|
455
|
+
>
|
|
456
|
+
<TabsContainer
|
|
457
|
+
width={orientationState?.orientation === LANDSCAPE ? orientationState?.dimensions?.width * 0.4 : windowWidth - 42}
|
|
458
|
+
>
|
|
459
|
+
{useLoginByEmail && (
|
|
460
|
+
<Pressable
|
|
461
|
+
style={styles.btnTab}
|
|
462
|
+
onPress={() => handleChangeTab('email')}>
|
|
463
|
+
<OText
|
|
464
|
+
style={styles.btnTabText}
|
|
465
|
+
color={
|
|
466
|
+
loginTab === 'email'
|
|
467
|
+
? theme.colors.black
|
|
468
|
+
: theme.colors.lightGray
|
|
469
|
+
}
|
|
470
|
+
weight={loginTab === 'email' ? '600' : 'normal'}>
|
|
471
|
+
{t('BY_EMAIL', 'by Email')}
|
|
472
|
+
</OText>
|
|
473
|
+
|
|
474
|
+
<View
|
|
475
|
+
style={{
|
|
476
|
+
width: '100%',
|
|
477
|
+
borderBottomColor:
|
|
478
|
+
loginTab === 'email'
|
|
479
|
+
? theme.colors.black
|
|
480
|
+
: theme.colors.border,
|
|
481
|
+
borderBottomWidth: 2,
|
|
482
|
+
}}></View>
|
|
483
|
+
</Pressable>
|
|
484
|
+
)}
|
|
485
|
+
|
|
486
|
+
{useLoginByCellphone && (
|
|
487
|
+
<Pressable
|
|
488
|
+
style={styles.btnTab}
|
|
489
|
+
onPress={() => handleChangeTab('cellphone')}>
|
|
490
|
+
<OText
|
|
491
|
+
style={styles.btnTabText}
|
|
492
|
+
color={
|
|
493
|
+
loginTab === 'cellphone'
|
|
494
|
+
? theme.colors.black
|
|
495
|
+
: theme.colors.lightGray
|
|
496
|
+
}
|
|
497
|
+
weight={loginTab === 'cellphone' ? '600' : 'normal'}>
|
|
498
|
+
{t('BY_PHONE', 'by Phone')}
|
|
499
|
+
</OText>
|
|
500
|
+
|
|
501
|
+
<View
|
|
502
|
+
style={{
|
|
503
|
+
width: '100%',
|
|
504
|
+
borderBottomColor:
|
|
505
|
+
loginTab === 'cellphone'
|
|
506
|
+
? theme.colors.black
|
|
507
|
+
: theme.colors.border,
|
|
508
|
+
borderBottomWidth: 2,
|
|
509
|
+
}}></View>
|
|
510
|
+
</Pressable>
|
|
511
|
+
)}
|
|
512
|
+
|
|
513
|
+
{useLoginOtpEmail && (
|
|
514
|
+
<Pressable
|
|
515
|
+
style={styles.btnTab}
|
|
516
|
+
onPress={() => handleChangeOtpType('email')}>
|
|
517
|
+
<OText
|
|
518
|
+
style={styles.btnTabText}
|
|
519
|
+
color={
|
|
520
|
+
isOtpEmail
|
|
521
|
+
? theme.colors.black
|
|
522
|
+
: theme.colors.lightGray
|
|
523
|
+
}
|
|
524
|
+
weight={isOtpEmail ? '600' : 'normal'}>
|
|
525
|
+
{t('BY_OTP_EMAIL', 'By Otp Email')}
|
|
526
|
+
</OText>
|
|
527
|
+
<View
|
|
528
|
+
style={{
|
|
529
|
+
width: '100%',
|
|
530
|
+
borderBottomColor:
|
|
531
|
+
isOtpEmail
|
|
532
|
+
? theme.colors.black
|
|
533
|
+
: theme.colors.border,
|
|
534
|
+
borderBottomWidth: 2,
|
|
535
|
+
}} />
|
|
536
|
+
</Pressable>
|
|
537
|
+
)}
|
|
538
|
+
{useLoginOtpCellphone && (
|
|
539
|
+
<Pressable
|
|
540
|
+
style={styles.btnTab}
|
|
541
|
+
onPress={() => handleChangeOtpType('cellphone')}>
|
|
542
|
+
<OText
|
|
543
|
+
style={styles.btnTabText}
|
|
544
|
+
color={
|
|
545
|
+
isOtpCellphone
|
|
546
|
+
? theme.colors.black
|
|
547
|
+
: theme.colors.lightGray
|
|
548
|
+
}
|
|
549
|
+
weight={isOtpCellphone ? '600' : 'normal'}>
|
|
550
|
+
{t('BY_OTP_PHONE', 'By Otp Phone')}
|
|
551
|
+
</OText>
|
|
552
|
+
<View
|
|
553
|
+
style={{
|
|
554
|
+
width: '100%',
|
|
555
|
+
borderBottomColor:
|
|
556
|
+
isOtpCellphone
|
|
557
|
+
? theme.colors.black
|
|
558
|
+
: theme.colors.border,
|
|
559
|
+
borderBottomWidth: 2,
|
|
560
|
+
}} />
|
|
561
|
+
</Pressable>
|
|
562
|
+
)}
|
|
563
|
+
</TabsContainer>
|
|
564
|
+
</ScrollView>
|
|
565
|
+
</LoginWith>
|
|
566
|
+
)}
|
|
567
|
+
|
|
568
|
+
{useRootPoint && (
|
|
569
|
+
<Controller
|
|
570
|
+
control={control}
|
|
571
|
+
name='project_name'
|
|
572
|
+
rules={{ required: t(`VALIDATION_ERROR_PROJECT_NAME_REQUIRED`, 'The field project name is required') }}
|
|
573
|
+
defaultValue=""
|
|
574
|
+
render={({ onChange, value }: any) => (
|
|
575
|
+
<OInput
|
|
576
|
+
name='project_name'
|
|
577
|
+
placeholder={t('PROJECT_NAME', 'Project Name')}
|
|
578
|
+
style={styles.inputStyle}
|
|
579
|
+
value={value}
|
|
580
|
+
autoCapitalize='none'
|
|
581
|
+
autoCorrect={false}
|
|
582
|
+
inputStyle={{ textAlign: 'center' }}
|
|
583
|
+
onChange={(e: any) => {
|
|
584
|
+
setProjectName(e?.target?.value)
|
|
585
|
+
onChange(e?.target?.value);
|
|
586
|
+
setFormsStateValues({
|
|
587
|
+
...formsStateValues,
|
|
588
|
+
isSubmitted: false,
|
|
589
|
+
})
|
|
590
|
+
}}
|
|
591
|
+
/>
|
|
592
|
+
)}
|
|
593
|
+
/>
|
|
594
|
+
)}
|
|
595
|
+
|
|
596
|
+
{((useLoginByEmail && loginTab === 'email') || (loginTab === 'otp' && otpType === 'email')) && (
|
|
597
|
+
<Controller
|
|
598
|
+
control={control}
|
|
599
|
+
render={({ onChange, value }: any) => (
|
|
600
|
+
<OInput
|
|
601
|
+
placeholder={t('USER', 'User')}
|
|
602
|
+
style={styles.inputStyle}
|
|
603
|
+
value={value}
|
|
604
|
+
autoCapitalize="none"
|
|
605
|
+
autoCorrect={false}
|
|
606
|
+
type="email-address"
|
|
607
|
+
inputStyle={{ textAlign: 'center' }}
|
|
608
|
+
onChange={(e: any) => {
|
|
609
|
+
handleChangeInputEmail(e, onChange);
|
|
610
|
+
}}
|
|
611
|
+
/>
|
|
612
|
+
)}
|
|
613
|
+
name="email"
|
|
614
|
+
rules={{
|
|
615
|
+
required: t(
|
|
616
|
+
'VALIDATION_ERROR_EMAIL_REQUIRED',
|
|
617
|
+
'The field Email is required',
|
|
618
|
+
).replace('_attribute_', t('EMAIL', 'Email')),
|
|
619
|
+
pattern: {
|
|
620
|
+
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
621
|
+
message: t(
|
|
622
|
+
'INVALID_ERROR_EMAIL',
|
|
623
|
+
'Invalid email address',
|
|
624
|
+
).replace('_attribute_', t('EMAIL', 'Email')),
|
|
625
|
+
},
|
|
626
|
+
}}
|
|
627
|
+
defaultValue=""
|
|
628
|
+
/>
|
|
629
|
+
)}
|
|
630
|
+
|
|
631
|
+
{((useLoginByCellphone && loginTab === 'cellphone') || (loginTab === 'otp' && otpType === 'cellphone')) && (
|
|
632
|
+
<View style={{ marginBottom: 20 }}>
|
|
633
|
+
<PhoneInputNumber
|
|
634
|
+
data={phoneInputData}
|
|
635
|
+
handleData={(val: any) => setPhoneInputData(val)}
|
|
636
|
+
onSubmitEditing={() => null}
|
|
637
|
+
textInputProps={{
|
|
638
|
+
returnKeyType: 'next',
|
|
639
|
+
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
640
|
+
}}
|
|
641
|
+
/>
|
|
642
|
+
</View>
|
|
643
|
+
)}
|
|
644
|
+
|
|
645
|
+
{loginTab !== 'otp' && (
|
|
646
|
+
<Controller
|
|
647
|
+
control={control}
|
|
648
|
+
render={({ onChange, value }: any) => (
|
|
649
|
+
<OInput
|
|
650
|
+
isSecured={true}
|
|
651
|
+
placeholder={t('PASSWORD', 'Password')}
|
|
652
|
+
style={styles.inputStyle}
|
|
653
|
+
value={value}
|
|
654
|
+
onChange={(val: any) => onChange(val)}
|
|
655
|
+
inputStyle={{ textAlign: 'center' }}
|
|
656
|
+
/>
|
|
657
|
+
)}
|
|
658
|
+
name="password"
|
|
659
|
+
rules={{
|
|
660
|
+
required: t(
|
|
661
|
+
'VALIDATION_ERROR_PASSWORD_REQUIRED',
|
|
662
|
+
'The field Password is required',
|
|
663
|
+
).replace('_attribute_', t('PASSWORD', 'Password')),
|
|
664
|
+
}}
|
|
665
|
+
defaultValue=""
|
|
666
|
+
forwardRef={inputRef}
|
|
667
|
+
/>
|
|
668
|
+
)}
|
|
669
|
+
|
|
670
|
+
{(recaptchaConfig?.version) && (
|
|
671
|
+
<>
|
|
672
|
+
{recaptchaConfig?.version === 'v3' ? (
|
|
673
|
+
<ReCaptcha
|
|
674
|
+
url={recaptchaConfig?.baseUrl}
|
|
675
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
676
|
+
containerStyle={{ height: 40 }}
|
|
677
|
+
onExecute={onRecaptchaVerify}
|
|
678
|
+
reCaptchaType={1}
|
|
679
|
+
/>
|
|
680
|
+
) : (
|
|
681
|
+
<>
|
|
682
|
+
<TouchableOpacity
|
|
683
|
+
onPress={handleOpenRecaptcha}
|
|
684
|
+
>
|
|
685
|
+
<RecaptchaButton>
|
|
686
|
+
{recaptchaVerified ? (
|
|
687
|
+
<MaterialCommunityIcons
|
|
688
|
+
name="checkbox-marked"
|
|
689
|
+
size={26}
|
|
690
|
+
color={theme.colors.primary}
|
|
691
|
+
/>
|
|
692
|
+
) : (
|
|
693
|
+
<MaterialCommunityIcons
|
|
694
|
+
name="checkbox-blank-outline"
|
|
695
|
+
size={26}
|
|
696
|
+
color={theme.colors.mediumGray}
|
|
697
|
+
/>
|
|
698
|
+
)}
|
|
699
|
+
<OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
|
|
700
|
+
</RecaptchaButton>
|
|
701
|
+
</TouchableOpacity>
|
|
702
|
+
<Recaptcha
|
|
703
|
+
ref={recaptchaRef}
|
|
704
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
705
|
+
baseUrl={recaptchaConfig?.baseUrl}
|
|
706
|
+
onVerify={onRecaptchaVerify}
|
|
707
|
+
onExpire={() => setRecaptchaVerified(false)}
|
|
708
|
+
/>
|
|
709
|
+
</>)
|
|
710
|
+
}
|
|
711
|
+
</>
|
|
712
|
+
)}
|
|
713
|
+
|
|
714
|
+
<OButton
|
|
715
|
+
onClick={handleSubmit(onSubmit)}
|
|
716
|
+
text={loginTab !== 'otp' ? loginButtonText : t('GET_VERIFY_CODE', 'Get verify code')}
|
|
717
|
+
imgRightSrc={null}
|
|
718
|
+
isLoading={formState.loading}
|
|
719
|
+
style={{ borderRadius: 0 }}
|
|
720
|
+
textStyle={{ fontSize: 24 }}
|
|
721
|
+
/>
|
|
420
722
|
</View>
|
|
723
|
+
|
|
421
724
|
{orientationState?.orientation === PORTRAIT && (
|
|
422
725
|
<View style={{
|
|
423
726
|
flexGrow: 1,
|
|
@@ -428,6 +731,27 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
428
731
|
</View>
|
|
429
732
|
)}
|
|
430
733
|
</View>
|
|
734
|
+
<OModal
|
|
735
|
+
open={willVerifyOtpState}
|
|
736
|
+
onClose={() => setWillVerifyOtpState(false)}
|
|
737
|
+
entireModal
|
|
738
|
+
title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
|
|
739
|
+
>
|
|
740
|
+
<Otp
|
|
741
|
+
willVerifyOtpState={willVerifyOtpState}
|
|
742
|
+
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
743
|
+
handleLoginOtp={handleLoginOtp}
|
|
744
|
+
onSubmit={onSubmit}
|
|
745
|
+
setAlertState={setAlertState}
|
|
746
|
+
/>
|
|
747
|
+
</OModal>
|
|
748
|
+
<Alert
|
|
749
|
+
open={alertState.open}
|
|
750
|
+
content={alertState.content}
|
|
751
|
+
title={alertState.title || ''}
|
|
752
|
+
onAccept={closeAlert}
|
|
753
|
+
onClose={closeAlert}
|
|
754
|
+
/>
|
|
431
755
|
</View>
|
|
432
756
|
);
|
|
433
757
|
};
|