fix: resolve type errors
This commit is contained in:
parent
b8bc0fa8b7
commit
eb63f580e0
2 changed files with 4 additions and 9 deletions
|
|
@ -21,4 +21,4 @@ export interface SendOtpResponse {
|
||||||
phoneNumber: string;
|
phoneNumber: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VerifyOtpResponse extends LoginSuccessPayload {}
|
export type VerifyOtpResponse = LoginSuccessPayload;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Button, Card, Form, Input, Typography, message } from 'antd';
|
import { Button, Card, Form, Input, Typography, message, type InputRef } from 'antd';
|
||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { useAppDispatch } from '../../utils/hooks';
|
import { useAppDispatch } from '../../utils/hooks';
|
||||||
|
|
@ -16,16 +16,11 @@ interface VerifyOtpFormValues {
|
||||||
const VerifyOtp = () => {
|
const VerifyOtp = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const [phoneNumber, setPhoneNumber] = useState('');
|
const [phoneNumber] = useState(() => localStorage.getItem('pending_phone_number') ?? '');
|
||||||
const [form] = Form.useForm<VerifyOtpFormValues>();
|
const [form] = Form.useForm<VerifyOtpFormValues>();
|
||||||
const otpInputRef = useRef<any>(null);
|
const otpInputRef = useRef<InputRef>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const storedPhoneNumber = localStorage.getItem('pending_phone_number');
|
|
||||||
if (storedPhoneNumber) {
|
|
||||||
setPhoneNumber(storedPhoneNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
const timeoutId = window.setTimeout(() => {
|
const timeoutId = window.setTimeout(() => {
|
||||||
otpInputRef.current?.focus();
|
otpInputRef.current?.focus();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue