diff --git a/package.json b/package.json index 1d59ec51..d1a02577 100644 --- a/package.json +++ b/package.json @@ -13,20 +13,20 @@ }, "dependencies": { "@react-native-async-storage/async-storage": "1.17.11", - "@react-native-firebase/app": "^16.4.6", - "@react-native-firebase/database": "^16.4.6", - "@react-navigation/native": "^6.0.16", - "@react-navigation/native-stack": "^6.9.4", + "@react-native-firebase/app": "16.4.6", + "@react-native-firebase/database": "16.4.6", + "@react-navigation/native": "6.0.16", + "@react-navigation/native-stack": "6.9.4", "@reduxjs/toolkit": "1.9.1", - "axios": "^1.2.1", + "axios": "1.2.1", "react": "18.1.0", "react-hook-form": "7.40.0", "react-native": "0.70.6", - "react-native-device-info": "^10.3.0", + "react-native-device-info": "10.3.0", "react-native-image-picker": "4.10.2", "react-native-pager-view": "6.1.2", - "react-native-safe-area-context": "^4.4.1", - "react-native-screens": "^3.18.2", + "react-native-safe-area-context": "4.4.1", + "react-native-screens": "3.18.2", "react-native-svg": "13.6.0", "react-native-tab-view": "3.3.2", "react-native-toast-message": "2.1.5", diff --git a/src/components/login/OtpInput.tsx b/src/components/login/OtpInput.tsx index 15c3cbb4..64adbca7 100644 --- a/src/components/login/OtpInput.tsx +++ b/src/components/login/OtpInput.tsx @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +import React from 'react'; import {Controller, useForm} from 'react-hook-form'; import {StyleSheet} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; @@ -11,14 +11,13 @@ import BackArrowIcon from '../../../RN-UI-LIB/src/Icons/BackArrowIcon'; import {GenericStyles} from '../../../RN-UI-LIB/src/styles'; import {COLORS} from '../../../RN-UI-LIB/src/styles/colors'; import { - generateOTP, verifyOTP, VerifyOTPPayload, } from '../../action/authActions'; import {useAppDispatch} from '../../hooks'; import {RootState} from '../../store/store'; -import {Countdown} from '../countdown'; import {navigateToScreen} from '../utlis/navigationUtlis'; +import OtpText from './OtpText'; interface IOtpForm { otp: string; @@ -35,8 +34,6 @@ const OtpInput = () => { (state: RootState) => state.loginInfo, ); - const [countDownComplete, setCountDownComplete] = useState(false); - const dispatch = useAppDispatch(); const handleVerifyOTP = (data: IOtpForm) => { @@ -51,49 +48,6 @@ const OtpInput = () => { navigateToScreen('Login'); }; - const handleResendOTP = () => { - dispatch(generateOTP({phoneNumber}, true)); - }; - - const renderOTPText = () => { - if (verifyOTPError) { - return ( - - {verifyOTPError}{' '} - - Resend OTP - - - ); - } - if (countDownComplete) { - return ( - - Enter 4 digits OTP or{' '} - - Resend OTP - - - ); - } - return ( - - Resend OTP in{' '} - { - setCountDownComplete(true); - }} - startFrom={30} - />{' '} - second - - ); - }; - return ( { name="otp" rules={{required: true, minLength: 4}} /> - {renderOTPText()} +