diff --git a/apps/web/app/[locale]/auth/passcode/component.tsx b/apps/web/app/[locale]/auth/passcode/component.tsx
index 1fe11c245..4887069ae 100644
--- a/apps/web/app/[locale]/auth/passcode/component.tsx
+++ b/apps/web/app/[locale]/auth/passcode/component.tsx
@@ -2,7 +2,7 @@
import { getAccessTokenCookie, getActiveUserIdCookie } from '@app/helpers';
import { TAuthenticationPasscode, useAuthenticationPasscode } from '@app/hooks';
-import { IClassName } from '@app/interfaces';
+import { IClassName, ISigninEmailConfirmWorkspaces } from '@app/interfaces';
import { clsxm } from '@app/utils';
import { AuthCodeInputField, Avatar, BackButton, Button, Card, InputField, SpinnerLoader, Text } from 'lib/components';
import { CircleIcon, CheckCircleOutlineIcon } from 'assets/svg';
@@ -10,7 +10,7 @@ import { AuthLayout } from 'lib/layout';
import { useTranslations } from 'next-intl';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
-import { FormEvent, useCallback, useEffect, useRef, useState } from 'react';
+import { Dispatch, FormEvent, FormEventHandler, SetStateAction, useCallback, useEffect, useRef, useState } from 'react';
import stc from 'string-to-color';
@@ -98,11 +98,17 @@ function EmailScreen({ form, className }: { form: TAuthenticationPasscode } & IC
/>
- {/* Send code */}
+
+ {t('pages.authLogin.HAVE_PASSWORD')}
+
+ {t('pages.authLogin.LOGIN_WITH_PASSWORD')}.
+
+
+
{t('common.DONT_HAVE_ACCOUNT')}
-
+
{t('common.REGISTER')}
@@ -227,8 +233,6 @@ function PasscodeScreen({ form, className }: { form: TAuthenticationPasscode } &
}
function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode } & IClassName) {
- const t = useTranslations();
-
const [selectedWorkspace, setSelectedWorkspace] = useState
(0);
const [selectedTeam, setSelectedTeam] = useState('');
const router = useRouter();
@@ -252,6 +256,7 @@ function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode }
if (form.workspaces.length === 1 && currentTeams?.length === 1) {
setSelectedTeam(currentTeams[0].team_id);
}
+
if (form.workspaces.length === 1 && (currentTeams?.length || 0) <= 1) {
setTimeout(() => {
document.getElementById('continue-to-workspace')?.click();
@@ -268,12 +273,43 @@ function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode }
}
}, [form.authScreen, router]);
- console.log(form);
+ return (
+ {
+ form.authScreen.setScreen('email');
+ form.setErrors({});
+ }}
+ selectedWorkspace={selectedWorkspace}
+ setSelectedWorkspace={setSelectedWorkspace}
+ setSelectedTeam={setSelectedTeam}
+ selectedTeam={selectedTeam}
+ signInWorkspaceLoading={form.signInWorkspaceLoading}
+ />
+ );
+}
+
+type IWorkSpace = {
+ className?: string;
+ workspaces: ISigninEmailConfirmWorkspaces[];
+ onSubmit?: FormEventHandler;
+ onBackButtonClick?: () => void;
+ selectedWorkspace: number;
+ setSelectedWorkspace: Dispatch>;
+ signInWorkspaceLoading?: boolean;
+ setSelectedTeam: Dispatch>;
+ selectedTeam: string;
+};
+
+export function WorkSpaceComponent(props: IWorkSpace) {
+ const t = useTranslations();
return (