ordering-ui-react-native 0.23.3 → 0.23.4
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity, Modal } from 'react-native';
|
|
3
3
|
import { useForm, Controller } from 'react-hook-form';
|
|
4
4
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
5
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
@@ -32,11 +32,9 @@ import {
|
|
|
32
32
|
} from '../LoginForm/styles';
|
|
33
33
|
|
|
34
34
|
import NavBar from '../NavBar';
|
|
35
|
-
import { VerifyPhone } from '../VerifyPhone';
|
|
36
35
|
|
|
37
36
|
import Alert from '../../../../../src/providers/AlertProvider'
|
|
38
37
|
import { OText, OButton, OInput } from '../shared';
|
|
39
|
-
import { OModal } from '../../../../../src/components/shared';
|
|
40
38
|
import { SignupParams } from '../../types';
|
|
41
39
|
import { sortInputFields } from '../../utils';
|
|
42
40
|
import { GoogleLogin } from '../GoogleLogin';
|
|
@@ -141,6 +139,8 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
141
139
|
const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
|
|
142
140
|
const [recaptchaVerified, setRecaptchaVerified] = useState(false)
|
|
143
141
|
const [tabLayouts, setTabLayouts] = useState<any>({})
|
|
142
|
+
const [isCheckingCode, setCheckingCode] = useState(false)
|
|
143
|
+
const [otpError, setOtpError] = useState(null)
|
|
144
144
|
|
|
145
145
|
const tabsRef = useRef<any>(null)
|
|
146
146
|
const nameRef = useRef<any>(null);
|
|
@@ -467,9 +467,16 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
467
467
|
|
|
468
468
|
useEffect(() => {
|
|
469
469
|
if (checkPhoneCodeState?.result?.error) {
|
|
470
|
-
|
|
470
|
+
const titleText = (
|
|
471
|
+
typeof checkPhoneCodeState?.result?.result === 'string'
|
|
472
|
+
? checkPhoneCodeState?.result?.result
|
|
473
|
+
: checkPhoneCodeState?.result?.result[0].toString()
|
|
474
|
+
) || t('ERROR', 'Error')
|
|
475
|
+
setCheckingCode(false)
|
|
476
|
+
setOtpError(titleText)
|
|
477
|
+
checkPhoneCodeState?.generate && setAlertState({
|
|
471
478
|
open: true,
|
|
472
|
-
title:
|
|
479
|
+
title: titleText,
|
|
473
480
|
content: []
|
|
474
481
|
})
|
|
475
482
|
}
|
|
@@ -967,13 +974,16 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
967
974
|
)
|
|
968
975
|
)}
|
|
969
976
|
</FormSide>
|
|
970
|
-
<
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
|
|
977
|
+
<Modal
|
|
978
|
+
visible={willVerifyOtpState}
|
|
979
|
+
onDismiss={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
|
|
980
|
+
animationType='slide'
|
|
975
981
|
>
|
|
976
982
|
<Otp
|
|
983
|
+
isCheckingCode={isCheckingCode}
|
|
984
|
+
setCheckingCode={setCheckingCode}
|
|
985
|
+
otpError={otpError}
|
|
986
|
+
setOtpError={setOtpError}
|
|
977
987
|
pinCount={numOtpInputs || 6}
|
|
978
988
|
willVerifyOtpState={willVerifyOtpState || false}
|
|
979
989
|
setWillVerifyOtpState={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
|
|
@@ -981,7 +991,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
981
991
|
onSubmit={onSubmit}
|
|
982
992
|
setAlertState={setAlertState}
|
|
983
993
|
/>
|
|
984
|
-
</
|
|
994
|
+
</Modal>
|
|
985
995
|
<Spinner
|
|
986
996
|
visible={formState.loading || validationFields.loading || isFBLoading}
|
|
987
997
|
/>
|