chore: EnterPasswordForm component created
This commit is contained in:
@@ -4,6 +4,7 @@ import type { AuthMode, AuthType } from '../types/auth-types';
|
|||||||
import { OtpVerifyForm } from './OtpVerifyForm';
|
import { OtpVerifyForm } from './OtpVerifyForm';
|
||||||
import { isNumeric } from '@/utils/regexes/isNumeric';
|
import { isNumeric } from '@/utils/regexes/isNumeric';
|
||||||
import { CompleteSignUp } from './CompleteSignUp';
|
import { CompleteSignUp } from './CompleteSignUp';
|
||||||
|
import { EnterPasswordForm } from './EnterPasswordForm';
|
||||||
|
|
||||||
export const AuthenticationContainer = (): JSX.Element => {
|
export const AuthenticationContainer = (): JSX.Element => {
|
||||||
const [authMode, setAuthMode] = useState<AuthMode>('register');
|
const [authMode, setAuthMode] = useState<AuthMode>('register');
|
||||||
@@ -27,7 +28,6 @@ export const AuthenticationContainer = (): JSX.Element => {
|
|||||||
|
|
||||||
const handleOTPVerfied = (otpCode: string) => {
|
const handleOTPVerfied = (otpCode: string) => {
|
||||||
if (authMode === 'register' && authType === 'email') {
|
if (authMode === 'register' && authType === 'email') {
|
||||||
setAuthType('phone');
|
|
||||||
setCurrentStep('addPhoneNumber');
|
setCurrentStep('addPhoneNumber');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -70,6 +70,13 @@ export const AuthenticationContainer = (): JSX.Element => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{currentStep === 'enterPassword' && (
|
||||||
|
<EnterPasswordForm
|
||||||
|
onLoginWithPassword={() => {}}
|
||||||
|
emailOrPhone={loginRegisterValue}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{currentStep === 'addPhoneNumber' && (
|
{currentStep === 'addPhoneNumber' && (
|
||||||
<CompleteSignUp
|
<CompleteSignUp
|
||||||
value={addedPhoneNumberValue}
|
value={addedPhoneNumberValue}
|
||||||
@@ -83,7 +90,7 @@ export const AuthenticationContainer = (): JSX.Element => {
|
|||||||
<OtpVerifyForm
|
<OtpVerifyForm
|
||||||
onOTPVerified={handleCompleteSignUpOTPVerified}
|
onOTPVerified={handleCompleteSignUpOTPVerified}
|
||||||
onEditValue={handleCompleteSignUpEditValue}
|
onEditValue={handleCompleteSignUpEditValue}
|
||||||
authMode="register"
|
authMode="login"
|
||||||
authType="phone"
|
authType="phone"
|
||||||
value={addedPhoneNumberValue}
|
value={addedPhoneNumberValue}
|
||||||
/>
|
/>
|
||||||
|
|||||||
14
src/features/authentication/components/EnterPasswordForm.tsx
Normal file
14
src/features/authentication/components/EnterPasswordForm.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { AuthenticationCard } from './AuthenticationCard';
|
||||||
|
|
||||||
|
export interface EnterPasswordFormProps {
|
||||||
|
onLoginWithPassword: () => void;
|
||||||
|
emailOrPhone: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const EnterPasswordForm = ({
|
||||||
|
onLoginWithPassword,
|
||||||
|
emailOrPhone,
|
||||||
|
}: EnterPasswordFormProps) => {
|
||||||
|
return <AuthenticationCard></AuthenticationCard>;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user