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 { isNumeric } from '@/utils/regexes/isNumeric';
|
||||
import { CompleteSignUp } from './CompleteSignUp';
|
||||
import { EnterPasswordForm } from './EnterPasswordForm';
|
||||
|
||||
export const AuthenticationContainer = (): JSX.Element => {
|
||||
const [authMode, setAuthMode] = useState<AuthMode>('register');
|
||||
@@ -27,7 +28,6 @@ export const AuthenticationContainer = (): JSX.Element => {
|
||||
|
||||
const handleOTPVerfied = (otpCode: string) => {
|
||||
if (authMode === 'register' && authType === 'email') {
|
||||
setAuthType('phone');
|
||||
setCurrentStep('addPhoneNumber');
|
||||
}
|
||||
};
|
||||
@@ -70,6 +70,13 @@ export const AuthenticationContainer = (): JSX.Element => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{currentStep === 'enterPassword' && (
|
||||
<EnterPasswordForm
|
||||
onLoginWithPassword={() => {}}
|
||||
emailOrPhone={loginRegisterValue}
|
||||
/>
|
||||
)}
|
||||
|
||||
{currentStep === 'addPhoneNumber' && (
|
||||
<CompleteSignUp
|
||||
value={addedPhoneNumberValue}
|
||||
@@ -83,7 +90,7 @@ export const AuthenticationContainer = (): JSX.Element => {
|
||||
<OtpVerifyForm
|
||||
onOTPVerified={handleCompleteSignUpOTPVerified}
|
||||
onEditValue={handleCompleteSignUpEditValue}
|
||||
authMode="register"
|
||||
authMode="login"
|
||||
authType="phone"
|
||||
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