ordering-ui-react-native 0.15.62 → 0.15.64-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 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessController/index.tsx +16 -8
- package/src/components/BusinessInformation/index.tsx +14 -0
- package/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +23 -2
- package/src/components/DriverTips/index.tsx +11 -6
- package/src/components/LanguageSelector/index.tsx +6 -2
- package/src/components/LoginForm/index.tsx +120 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/PaymentOptions/index.tsx +67 -50
- 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 +145 -61
- package/src/components/SingleProductCard/index.tsx +16 -4
- package/src/components/SingleProductReview/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +22 -24
- package/src/components/UpsellingProducts/index.tsx +1 -1
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OModal.tsx +1 -1
- package/src/hooks/useCountdownTimer.tsx +26 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +12 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/pages/Sessions.tsx +22 -0
- package/src/theme.json +0 -1
- package/src/types/index.tsx +18 -11
- package/src/utils/index.tsx +68 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
- package/themes/business/src/components/Chat/index.tsx +42 -90
- package/themes/business/src/components/DriverMap/index.tsx +6 -5
- package/themes/business/src/components/LoginForm/index.tsx +89 -2
- package/themes/business/src/components/LoginForm/styles.tsx +6 -0
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +14 -7
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +8 -4
- package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
- package/themes/business/src/components/ProductItemAccordion/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/OModal.tsx +1 -1
- package/themes/business/src/types/index.tsx +8 -2
- 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/BusinessMenu/index.tsx +39 -28
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
- package/themes/kiosk/src/components/Cart/index.tsx +11 -12
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
- package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
- package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
- package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
- package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +1 -0
- package/themes/original/index.tsx +30 -8
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +7 -6
- package/themes/original/src/components/AddressList/index.tsx +30 -18
- package/themes/original/src/components/AppleLogin/index.tsx +7 -12
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +305 -159
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +168 -96
- package/themes/original/src/components/BusinessController/styles.tsx +5 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +231 -63
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +51 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +317 -155
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +32 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -39
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +560 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +679 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +99 -458
- package/themes/original/src/components/Cart/index.tsx +62 -43
- package/themes/original/src/components/Checkout/index.tsx +90 -39
- package/themes/original/src/components/DriverTips/index.tsx +17 -12
- package/themes/original/src/components/Favorite/index.tsx +92 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +298 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GPSButton/index.tsx +15 -8
- package/themes/original/src/components/GoogleMap/index.tsx +11 -11
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/original/src/components/LoginForm/index.tsx +332 -164
- package/themes/original/src/components/LoginForm/styles.tsx +1 -3
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.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 +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +120 -32
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/NavBar/index.tsx +4 -4
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +151 -65
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderSummary/index.tsx +6 -6
- package/themes/original/src/components/OrderTypeSelector/index.tsx +79 -35
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +137 -38
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +58 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
- package/themes/original/src/components/ProductForm/index.tsx +718 -679
- package/themes/original/src/components/ProductForm/styles.tsx +6 -2
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
- package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/Promotions/index.tsx +151 -133
- package/themes/original/src/components/Promotions/styles.tsx +3 -23
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/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 +13 -5
- package/themes/original/src/components/ServiceForm/index.tsx +579 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SignupForm/index.tsx +237 -126
- package/themes/original/src/components/SingleOrderCard/index.tsx +275 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +161 -88
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
- package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
- package/themes/original/src/components/UserDetails/index.tsx +15 -81
- package/themes/original/src/components/UserFormDetails/index.tsx +98 -66
- package/themes/original/src/components/UserProfile/index.tsx +11 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +33 -22
- package/themes/original/src/components/UserVerification/index.tsx +178 -192
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +76 -9
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/OBottomPopup.tsx +44 -13
- package/themes/original/src/components/shared/OButton.tsx +2 -0
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/components/shared/OModal.tsx +4 -2
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +187 -35
- package/themes/original/src/utils/index.tsx +96 -2
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -18,7 +18,6 @@ import { useTheme } from 'styled-components/native';
|
|
|
18
18
|
import { FacebookLogin } from '../FacebookLogin';
|
|
19
19
|
import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
|
|
20
20
|
import { OModal } from '../../../../../src/components/shared';
|
|
21
|
-
|
|
22
21
|
import {
|
|
23
22
|
Container,
|
|
24
23
|
ButtonsWrapper,
|
|
@@ -32,17 +31,19 @@ import {
|
|
|
32
31
|
LineSeparator,
|
|
33
32
|
SkeletonWrapper,
|
|
34
33
|
TabBtn,
|
|
35
|
-
|
|
34
|
+
RecaptchaButton
|
|
36
35
|
} from './styles';
|
|
37
36
|
|
|
38
37
|
import NavBar from '../NavBar';
|
|
39
38
|
|
|
40
|
-
import { OText, OButton, OInput
|
|
39
|
+
import { OText, OButton, OInput } from '../shared';
|
|
41
40
|
import { LoginParams } from '../../types';
|
|
42
41
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
43
42
|
import { GoogleLogin } from '../GoogleLogin';
|
|
44
43
|
import { AppleLogin } from '../AppleLogin';
|
|
44
|
+
import { Otp } from './Otp'
|
|
45
45
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
46
|
+
import Alert from '../../../../../src/providers/AlertProvider'
|
|
46
47
|
|
|
47
48
|
const LoginFormUI = (props: LoginParams) => {
|
|
48
49
|
const {
|
|
@@ -51,6 +52,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
51
52
|
navigation,
|
|
52
53
|
useLoginByEmail,
|
|
53
54
|
useLoginByCellphone,
|
|
55
|
+
useLoginOtp,
|
|
54
56
|
loginButtonText,
|
|
55
57
|
forgotButtonText,
|
|
56
58
|
verifyPhoneState,
|
|
@@ -63,7 +65,12 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
63
65
|
onNavigationRedirect,
|
|
64
66
|
notificationState,
|
|
65
67
|
handleReCaptcha,
|
|
66
|
-
enableReCaptcha
|
|
68
|
+
enableReCaptcha,
|
|
69
|
+
otpType,
|
|
70
|
+
setOtpType,
|
|
71
|
+
generateOtpCode,
|
|
72
|
+
useLoginOtpEmail,
|
|
73
|
+
useLoginOtpCellphone,
|
|
67
74
|
} = props;
|
|
68
75
|
|
|
69
76
|
const [, { showToast }] = useToast();
|
|
@@ -75,6 +82,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
75
82
|
const [isLoadingVerifyModal, setIsLoadingVerifyModal] = useState(false);
|
|
76
83
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
77
84
|
const [isFBLoading, setIsFBLoading] = useState(false);
|
|
85
|
+
const [willVerifyOtpState, setWillVerifyOtpState] = useState(false)
|
|
78
86
|
const [phoneInputData, setPhoneInputData] = useState({
|
|
79
87
|
error: '',
|
|
80
88
|
phone: {
|
|
@@ -84,8 +92,17 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
84
92
|
});
|
|
85
93
|
const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
|
|
86
94
|
const [recaptchaVerified, setRecaptchaVerified] = useState(false)
|
|
95
|
+
const [alertState, setAlertState] = useState({ open: false, title: '', content: [] })
|
|
96
|
+
const [tabLayouts, setTabLayouts] = useState<any>({})
|
|
97
|
+
const tabsRef = useRef<any>(null)
|
|
87
98
|
|
|
88
99
|
const theme = useTheme();
|
|
100
|
+
const isOtpEmail = loginTab === 'otp' && otpType === 'email'
|
|
101
|
+
const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
|
|
102
|
+
|
|
103
|
+
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
104
|
+
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
105
|
+
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
89
106
|
|
|
90
107
|
const loginStyle = StyleSheet.create({
|
|
91
108
|
btnOutline: {
|
|
@@ -106,32 +123,68 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
106
123
|
marginBottom: 7,
|
|
107
124
|
},
|
|
108
125
|
recaptchaIcon: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
126
|
+
width: 100,
|
|
127
|
+
height: 100,
|
|
128
|
+
},
|
|
129
|
+
borderStyleBase: {
|
|
130
|
+
width: 30,
|
|
131
|
+
height: 45
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
borderStyleHighLighted: {
|
|
135
|
+
borderColor: "#03DAC6",
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
underlineStyleBase: {
|
|
139
|
+
width: 45,
|
|
140
|
+
height: 60,
|
|
141
|
+
borderWidth: 1,
|
|
142
|
+
fontSize: 16
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
underlineStyleHighLighted: {
|
|
146
|
+
borderColor: theme.colors.primary,
|
|
147
|
+
color: theme.colors.primary,
|
|
148
|
+
fontSize: 16
|
|
149
|
+
},
|
|
112
150
|
});
|
|
113
151
|
|
|
114
152
|
const emailRef = useRef<any>({});
|
|
115
153
|
const passwordRef = useRef<any>({});
|
|
116
|
-
|
|
154
|
+
const recaptchaRef = useRef<any>({});
|
|
117
155
|
|
|
118
|
-
const handleChangeTab = (val: string) => {
|
|
156
|
+
const handleChangeTab = (val: string, otpType?: string) => {
|
|
119
157
|
props.handleChangeTab(val);
|
|
120
158
|
setPasswordSee(false);
|
|
159
|
+
handleCategoryScroll(otpType ? `${val}_${otpType}` : val)
|
|
121
160
|
};
|
|
122
161
|
|
|
123
|
-
const onSubmit = (values
|
|
162
|
+
const onSubmit = (values?: any) => {
|
|
124
163
|
Keyboard.dismiss();
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
164
|
+
if (loginTab === 'otp') {
|
|
165
|
+
if (phoneInputData.error && (loginTab !== 'otp' || (otpType === 'cellphone' && loginTab === 'otp'))) {
|
|
166
|
+
showToast(ToastType.Error, t('INVALID_PHONE_NUMBER', 'Invalid phone number'));
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
if (loginTab === 'otp') {
|
|
170
|
+
generateOtpCode({
|
|
171
|
+
...values,
|
|
172
|
+
...phoneInputData.phone
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
setWillVerifyOtpState(true)
|
|
176
|
+
} else {
|
|
177
|
+
if (phoneInputData.error) {
|
|
178
|
+
showToast(ToastType.Error, phoneInputData.error);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
handleButtonLoginClick({
|
|
182
|
+
...values,
|
|
183
|
+
...phoneInputData.phone,
|
|
184
|
+
});
|
|
128
185
|
}
|
|
129
|
-
handleButtonLoginClick({
|
|
130
|
-
...values,
|
|
131
|
-
...phoneInputData.phone,
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
186
|
|
|
187
|
+
};
|
|
135
188
|
const handleVerifyCodeClick = () => {
|
|
136
189
|
if (phoneInputData.error) {
|
|
137
190
|
showToast(ToastType.Error, phoneInputData.error);
|
|
@@ -166,9 +219,9 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
166
219
|
onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''));
|
|
167
220
|
};
|
|
168
221
|
|
|
169
|
-
|
|
222
|
+
const handleOpenRecaptcha = () => {
|
|
170
223
|
setRecaptchaVerified(false)
|
|
171
|
-
|
|
224
|
+
if (!recaptchaConfig?.siteKey) {
|
|
172
225
|
showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
|
|
173
226
|
return
|
|
174
227
|
}
|
|
@@ -176,14 +229,47 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
176
229
|
showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
|
|
177
230
|
return
|
|
178
231
|
}
|
|
232
|
+
|
|
179
233
|
recaptchaRef.current.open()
|
|
180
|
-
|
|
234
|
+
}
|
|
181
235
|
|
|
182
236
|
const onRecaptchaVerify = (token: any) => {
|
|
183
237
|
setRecaptchaVerified(true)
|
|
184
238
|
handleReCaptcha(token)
|
|
185
239
|
}
|
|
186
240
|
|
|
241
|
+
const handleChangeOtpType = (type: string) => {
|
|
242
|
+
handleChangeTab('otp', type)
|
|
243
|
+
setOtpType(type)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const handleLoginOtp = (code: string) => {
|
|
247
|
+
handleButtonLoginClick({ code })
|
|
248
|
+
setWillVerifyOtpState(false)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const closeAlert = () => {
|
|
252
|
+
setAlertState({
|
|
253
|
+
open: false,
|
|
254
|
+
title: '',
|
|
255
|
+
content: []
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const handleCategoryScroll = (opc: string) => {
|
|
260
|
+
tabsRef.current.scrollTo({
|
|
261
|
+
x: tabLayouts?.[opc]?.x - 40,
|
|
262
|
+
animated: true
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const handleOnLayout = (event: any, opc: string) => {
|
|
267
|
+
const _tabLayouts = { ...tabLayouts }
|
|
268
|
+
const categoryKey = opc
|
|
269
|
+
_tabLayouts[categoryKey] = event.nativeEvent.layout
|
|
270
|
+
setTabLayouts(_tabLayouts)
|
|
271
|
+
}
|
|
272
|
+
|
|
187
273
|
useEffect(() => {
|
|
188
274
|
if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
|
|
189
275
|
setRecaptchaConfig({
|
|
@@ -231,16 +317,26 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
231
317
|
}, [phoneInputData?.phone?.cellphone])
|
|
232
318
|
|
|
233
319
|
useEffect(() => {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
320
|
+
register('cellphone', {
|
|
321
|
+
required: loginTab === 'cellphone'
|
|
322
|
+
? t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Mobile phone is required').replace('_attribute_', t('CELLPHONE', 'Cellphone'))
|
|
323
|
+
: null
|
|
324
|
+
})
|
|
325
|
+
}, [register])
|
|
326
|
+
|
|
327
|
+
useEffect(() => {
|
|
328
|
+
reset()
|
|
329
|
+
}, [loginTab])
|
|
240
330
|
|
|
241
331
|
useEffect(() => {
|
|
242
|
-
|
|
243
|
-
|
|
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])
|
|
244
340
|
|
|
245
341
|
return (
|
|
246
342
|
<Container>
|
|
@@ -255,11 +351,18 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
255
351
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
256
352
|
/>
|
|
257
353
|
<FormSide>
|
|
258
|
-
{useLoginByEmail
|
|
354
|
+
{(Number(useLoginByEmail) + Number(useLoginByCellphone) + Number(useLoginOtpEmail) + Number(useLoginOtpCellphone) > 1) && (
|
|
259
355
|
<LoginWith>
|
|
260
|
-
<OTabs
|
|
356
|
+
<OTabs
|
|
357
|
+
horizontal
|
|
358
|
+
showsHorizontalScrollIndicator={false}
|
|
359
|
+
ref={tabsRef}
|
|
360
|
+
>
|
|
261
361
|
{useLoginByEmail && (
|
|
262
|
-
<TabBtn
|
|
362
|
+
<TabBtn
|
|
363
|
+
onPress={() => handleChangeTab('email')}
|
|
364
|
+
onLayout={(event: any) => handleOnLayout(event, 'email')}
|
|
365
|
+
>
|
|
263
366
|
<OTab
|
|
264
367
|
style={{
|
|
265
368
|
borderBottomColor:
|
|
@@ -281,7 +384,10 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
281
384
|
</TabBtn>
|
|
282
385
|
)}
|
|
283
386
|
{useLoginByCellphone && (
|
|
284
|
-
<TabBtn
|
|
387
|
+
<TabBtn
|
|
388
|
+
onPress={() => handleChangeTab('cellphone')}
|
|
389
|
+
onLayout={(event: any) => handleOnLayout(event, 'cellphone')}
|
|
390
|
+
>
|
|
285
391
|
<OTab
|
|
286
392
|
style={{
|
|
287
393
|
borderBottomColor:
|
|
@@ -302,13 +408,63 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
302
408
|
</OTab>
|
|
303
409
|
</TabBtn>
|
|
304
410
|
)}
|
|
411
|
+
{useLoginOtpEmail && (
|
|
412
|
+
<TabBtn
|
|
413
|
+
onPress={() => handleChangeOtpType('email')}
|
|
414
|
+
onLayout={(event: any) => handleOnLayout(event, 'otp_email')}
|
|
415
|
+
>
|
|
416
|
+
<OTab
|
|
417
|
+
style={{
|
|
418
|
+
borderBottomColor:
|
|
419
|
+
isOtpEmail
|
|
420
|
+
? theme.colors.textNormal
|
|
421
|
+
: theme.colors.border,
|
|
422
|
+
}}>
|
|
423
|
+
<OText
|
|
424
|
+
size={14}
|
|
425
|
+
color={
|
|
426
|
+
isOtpEmail
|
|
427
|
+
? theme.colors.textNormal
|
|
428
|
+
: theme.colors.disabled
|
|
429
|
+
}
|
|
430
|
+
weight={isOtpEmail ? 'bold' : 'normal'}>
|
|
431
|
+
{t('BY_OTP_EMAIL', 'By Otp Email')}
|
|
432
|
+
</OText>
|
|
433
|
+
</OTab>
|
|
434
|
+
</TabBtn>
|
|
435
|
+
)}
|
|
436
|
+
{useLoginOtpCellphone && (
|
|
437
|
+
<TabBtn
|
|
438
|
+
onPress={() => handleChangeOtpType('cellphone')}
|
|
439
|
+
onLayout={(event: any) => handleOnLayout(event, 'otp_cellphone')}
|
|
440
|
+
>
|
|
441
|
+
<OTab
|
|
442
|
+
style={{
|
|
443
|
+
borderBottomColor:
|
|
444
|
+
isOtpCellphone
|
|
445
|
+
? theme.colors.textNormal
|
|
446
|
+
: theme.colors.border,
|
|
447
|
+
}}>
|
|
448
|
+
<OText
|
|
449
|
+
size={14}
|
|
450
|
+
color={
|
|
451
|
+
isOtpCellphone
|
|
452
|
+
? theme.colors.textNormal
|
|
453
|
+
: theme.colors.disabled
|
|
454
|
+
}
|
|
455
|
+
weight={isOtpCellphone ? 'bold' : 'normal'}>
|
|
456
|
+
{t('BY_OTP_PHONE', 'By Otp Phone')}
|
|
457
|
+
</OText>
|
|
458
|
+
</OTab>
|
|
459
|
+
</TabBtn>
|
|
460
|
+
)}
|
|
305
461
|
</OTabs>
|
|
306
462
|
</LoginWith>
|
|
307
463
|
)}
|
|
308
464
|
|
|
309
|
-
{(useLoginByCellphone || useLoginByEmail) && (
|
|
465
|
+
{(useLoginByCellphone || useLoginByEmail || useLoginOtp) && (
|
|
310
466
|
<FormInput>
|
|
311
|
-
{useLoginByEmail && loginTab === 'email' && (
|
|
467
|
+
{((useLoginByEmail && loginTab === 'email') || (loginTab === 'otp' && otpType === 'email')) && (
|
|
312
468
|
<>
|
|
313
469
|
{errors?.email && (
|
|
314
470
|
<OText
|
|
@@ -344,10 +500,10 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
344
500
|
rules={{
|
|
345
501
|
required: {
|
|
346
502
|
value: true,
|
|
347
|
-
message:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
503
|
+
message: t(
|
|
504
|
+
'VALIDATION_ERROR_EMAIL_REQUIRED',
|
|
505
|
+
'The field Email is required',
|
|
506
|
+
).replace('_attribute_', t('EMAIL', 'Email'))
|
|
351
507
|
},
|
|
352
508
|
pattern: {
|
|
353
509
|
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
@@ -362,7 +518,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
362
518
|
</>
|
|
363
519
|
|
|
364
520
|
)}
|
|
365
|
-
{useLoginByCellphone && loginTab === 'cellphone' && (
|
|
521
|
+
{((useLoginByCellphone && loginTab === 'cellphone') || (loginTab === 'otp' && otpType === 'cellphone')) && (
|
|
366
522
|
<View style={{ marginBottom: 28 }}>
|
|
367
523
|
<PhoneInputNumber
|
|
368
524
|
data={phoneInputData}
|
|
@@ -383,53 +539,56 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
383
539
|
{errors?.password?.message}{errors?.password?.type === 'required' && '*'}
|
|
384
540
|
</OText>
|
|
385
541
|
)}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
542
|
+
{loginTab !== 'otp' && (
|
|
543
|
+
|
|
544
|
+
<Controller
|
|
545
|
+
control={control}
|
|
546
|
+
render={({ onChange, value }: any) => (
|
|
547
|
+
<OInput
|
|
548
|
+
isSecured={!passwordSee ? true : false}
|
|
549
|
+
placeholder={t('PASSWORD', 'Password')}
|
|
550
|
+
style={{ ...loginStyle.inputStyle, marginBottom: 14 }}
|
|
551
|
+
icon={theme.images.general.lock}
|
|
552
|
+
iconCustomRight={
|
|
553
|
+
!passwordSee ? (
|
|
554
|
+
<MaterialCommunityIcons
|
|
555
|
+
name="eye-outline"
|
|
556
|
+
size={24}
|
|
557
|
+
onPress={() => setPasswordSee(!passwordSee)}
|
|
558
|
+
color={theme.colors.disabled}
|
|
559
|
+
/>
|
|
560
|
+
) : (
|
|
561
|
+
<MaterialCommunityIcons
|
|
562
|
+
name="eye-off-outline"
|
|
563
|
+
size={24}
|
|
564
|
+
onPress={() => setPasswordSee(!passwordSee)}
|
|
565
|
+
color={theme.colors.disabled}
|
|
566
|
+
/>
|
|
567
|
+
)
|
|
568
|
+
}
|
|
569
|
+
value={value}
|
|
570
|
+
forwardRef={passwordRef}
|
|
571
|
+
onChange={(val: any) => onChange(val)}
|
|
572
|
+
returnKeyType="done"
|
|
573
|
+
onSubmitEditing={handleSubmit(onSubmit)}
|
|
574
|
+
blurOnSubmit
|
|
575
|
+
borderColor={errors?.password ? theme.colors.danger5 : theme.colors.border}
|
|
576
|
+
/>
|
|
577
|
+
)}
|
|
578
|
+
name="password"
|
|
579
|
+
rules={{
|
|
580
|
+
required: {
|
|
581
|
+
value: true,
|
|
582
|
+
message: t(
|
|
583
|
+
'VALIDATION_ERROR_PASSWORD_REQUIRED',
|
|
584
|
+
'The field Password is required',
|
|
585
|
+
).replace('_attribute_', t('PASSWORD', 'Password'))
|
|
410
586
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
blurOnSubmit
|
|
417
|
-
borderColor={errors?.password ? theme.colors.danger5 : theme.colors.border}
|
|
418
|
-
/>
|
|
419
|
-
)}
|
|
420
|
-
name="password"
|
|
421
|
-
rules={{
|
|
422
|
-
required: {
|
|
423
|
-
value: true,
|
|
424
|
-
message: t(
|
|
425
|
-
'VALIDATION_ERROR_PASSWORD_REQUIRED',
|
|
426
|
-
'The field Password is required',
|
|
427
|
-
).replace('_attribute_', t('PASSWORD', 'Password'))
|
|
428
|
-
}
|
|
429
|
-
}}
|
|
430
|
-
defaultValue=""
|
|
431
|
-
/>
|
|
432
|
-
{onNavigationRedirect && forgotButtonText && (
|
|
587
|
+
}}
|
|
588
|
+
defaultValue=""
|
|
589
|
+
/>
|
|
590
|
+
)}
|
|
591
|
+
{onNavigationRedirect && forgotButtonText && loginTab !== 'otp' && (
|
|
433
592
|
<TouchableOpacity onPress={() => onNavigationRedirect('Forgot')}>
|
|
434
593
|
<OText size={14} mBottom={18}>
|
|
435
594
|
{forgotButtonText}
|
|
@@ -468,10 +627,9 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
468
627
|
/>
|
|
469
628
|
</>
|
|
470
629
|
)}
|
|
471
|
-
|
|
472
630
|
<OButton
|
|
473
631
|
onClick={handleSubmit(onSubmit)}
|
|
474
|
-
text={loginButtonText}
|
|
632
|
+
text={loginTab !== 'otp' ? loginButtonText : t('GET_VERIFY_CODE', 'Get verify code')}
|
|
475
633
|
bgColor={theme.colors.primary}
|
|
476
634
|
borderColor={theme.colors.primary}
|
|
477
635
|
textStyle={{ color: 'white' }}
|
|
@@ -480,11 +638,11 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
480
638
|
style={{ borderRadius: 7.6, marginTop: 10, marginBottom: 25 }}
|
|
481
639
|
/>
|
|
482
640
|
{onNavigationRedirect && registerButtonText && (
|
|
483
|
-
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center'}}>
|
|
641
|
+
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}>
|
|
484
642
|
<OText size={14}>
|
|
485
643
|
{t('NEW_ON_PLATFORM', 'New on Ordering?')}
|
|
486
644
|
</OText>
|
|
487
|
-
|
|
645
|
+
<TouchableOpacity onPress={() => onNavigationRedirect('Signup')}>
|
|
488
646
|
<OText size={14} mLeft={5} color={theme.colors.skyBlue}>
|
|
489
647
|
{t('CREATE_ACCOUNT', 'Create account')}
|
|
490
648
|
</OText>
|
|
@@ -495,11 +653,11 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
495
653
|
)}
|
|
496
654
|
|
|
497
655
|
{useLoginByCellphone &&
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
656
|
+
loginTab === 'cellphone' &&
|
|
657
|
+
configs && Object.keys(configs).length > 0 &&
|
|
658
|
+
(configs?.twilio_service_enabled?.value === 'true' ||
|
|
659
|
+
configs?.twilio_service_enabled?.value === '1') &&
|
|
660
|
+
configs?.twilio_module?.value && (
|
|
503
661
|
<>
|
|
504
662
|
<OrSeparator>
|
|
505
663
|
<LineSeparator />
|
|
@@ -524,59 +682,60 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
524
682
|
)}
|
|
525
683
|
|
|
526
684
|
{configs && Object.keys(configs).length > 0 ? (
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
685
|
+
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
686
|
+
(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null)) &&
|
|
687
|
+
(
|
|
688
|
+
<>
|
|
689
|
+
<View
|
|
690
|
+
style={{
|
|
691
|
+
flexDirection: 'row',
|
|
692
|
+
width: '100%',
|
|
693
|
+
justifyContent: 'space-between',
|
|
694
|
+
alignItems: 'center',
|
|
695
|
+
marginVertical: 15
|
|
696
|
+
}}>
|
|
697
|
+
<View style={loginStyle.line} />
|
|
698
|
+
<OText
|
|
699
|
+
size={14}
|
|
700
|
+
mBottom={10}
|
|
701
|
+
style={{ paddingHorizontal: 19 }}
|
|
702
|
+
color={theme.colors.disabled}>
|
|
703
|
+
{t('OR', 'or')}
|
|
704
|
+
</OText>
|
|
705
|
+
<View style={loginStyle.line} />
|
|
706
|
+
</View>
|
|
707
|
+
<ButtonsWrapper>
|
|
708
|
+
<SocialButtons>
|
|
709
|
+
{(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
|
|
710
|
+
configs?.facebook_id?.value &&
|
|
711
|
+
facebookLoginEnabled && (
|
|
712
|
+
<FacebookLogin
|
|
713
|
+
notificationState={notificationState}
|
|
714
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
715
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
716
|
+
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
717
|
+
/>
|
|
718
|
+
)}
|
|
719
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
720
|
+
<GoogleLogin
|
|
721
|
+
notificationState={notificationState}
|
|
722
|
+
webClientId={configs?.google_login_client_id?.value}
|
|
723
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
724
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
725
|
+
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
726
|
+
/>
|
|
727
|
+
)}
|
|
728
|
+
{(configs?.apple_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && appleLoginEnabled && (
|
|
729
|
+
<AppleLogin
|
|
730
|
+
notificationState={notificationState}
|
|
731
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
732
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
733
|
+
handleSuccessAppleLogin={handleSuccessFacebook}
|
|
734
|
+
/>
|
|
735
|
+
)}
|
|
736
|
+
</SocialButtons>
|
|
737
|
+
</ButtonsWrapper>
|
|
738
|
+
</>
|
|
580
739
|
)
|
|
581
740
|
) : (
|
|
582
741
|
<SkeletonWrapper>
|
|
@@ -592,24 +751,12 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
592
751
|
</Placeholder>
|
|
593
752
|
</SkeletonWrapper>
|
|
594
753
|
)}
|
|
595
|
-
|
|
596
|
-
{/* {onNavigationRedirect && registerButtonText && (
|
|
597
|
-
<ButtonsWrapper>
|
|
598
|
-
<OButton
|
|
599
|
-
onClick={() => onNavigationRedirect('Signup')}
|
|
600
|
-
text={registerButtonText}
|
|
601
|
-
style={loginStyle.btnOutline}
|
|
602
|
-
borderColor={theme.colors.primary}
|
|
603
|
-
imgRightSrc={null}
|
|
604
|
-
/>
|
|
605
|
-
</ButtonsWrapper>
|
|
606
|
-
)} */}
|
|
607
754
|
</FormSide>
|
|
608
755
|
<OModal
|
|
609
756
|
open={isModalVisible}
|
|
610
757
|
onClose={() => setIsModalVisible(false)}
|
|
611
|
-
|
|
612
|
-
|
|
758
|
+
entireModal
|
|
759
|
+
title={t('VERIFY_PHONE', 'Verify Phone')}
|
|
613
760
|
>
|
|
614
761
|
<VerifyPhone
|
|
615
762
|
phone={phoneInputData.phone}
|
|
@@ -618,9 +765,30 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
618
765
|
handleCheckPhoneCode={handleCheckPhoneCode}
|
|
619
766
|
setCheckPhoneCodeState={setCheckPhoneCodeState}
|
|
620
767
|
handleVerifyCodeClick={handleVerifyCodeClick}
|
|
621
|
-
|
|
768
|
+
onClose={() => setIsModalVisible(false)}
|
|
769
|
+
/>
|
|
770
|
+
</OModal>
|
|
771
|
+
<OModal
|
|
772
|
+
open={willVerifyOtpState}
|
|
773
|
+
onClose={() => setWillVerifyOtpState(false)}
|
|
774
|
+
entireModal
|
|
775
|
+
title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
|
|
776
|
+
>
|
|
777
|
+
<Otp
|
|
778
|
+
willVerifyOtpState={willVerifyOtpState}
|
|
779
|
+
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
780
|
+
handleLoginOtp={handleLoginOtp}
|
|
781
|
+
onSubmit={onSubmit}
|
|
782
|
+
setAlertState={setAlertState}
|
|
622
783
|
/>
|
|
623
784
|
</OModal>
|
|
785
|
+
<Alert
|
|
786
|
+
open={alertState.open}
|
|
787
|
+
content={alertState.content}
|
|
788
|
+
title={alertState.title || ''}
|
|
789
|
+
onAccept={closeAlert}
|
|
790
|
+
onClose={closeAlert}
|
|
791
|
+
/>
|
|
624
792
|
<Spinner visible={isFBLoading} />
|
|
625
793
|
</Container>
|
|
626
794
|
);
|
|
@@ -629,7 +797,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
629
797
|
export const LoginForm = (props: any) => {
|
|
630
798
|
const loginProps = {
|
|
631
799
|
...props,
|
|
632
|
-
|
|
800
|
+
isRecaptchaEnable: true,
|
|
633
801
|
UIComponent: LoginFormUI,
|
|
634
802
|
};
|
|
635
803
|
return <LoginFormController {...loginProps} />;
|