diff --git a/src/features/auth/login-form/ui/login-form.tsx b/src/features/auth/login-form/ui/login-form.tsx index 808756d..0e4f2e2 100644 --- a/src/features/auth/login-form/ui/login-form.tsx +++ b/src/features/auth/login-form/ui/login-form.tsx @@ -98,9 +98,7 @@ export const LoginForm = ({ type }: LoginFormProps) => { type='submit' className='w-full' disabled={isLoginLoading} - > - Войти - + /> ); diff --git a/src/pages-templates/login/index.tsx b/src/pages-templates/login/index.tsx index d2e12ed..195fbfe 100644 --- a/src/pages-templates/login/index.tsx +++ b/src/pages-templates/login/index.tsx @@ -1,11 +1,11 @@ -"use client" +'use client'; import { Building2, Fuel, User } from 'lucide-react'; import Link from 'next/link'; import { LoginForm } from '@/features/auth/login-form'; -import { useLanguage } from '@/shared/language'; +import { useLanguage } from '@/shared/language'; import { Card, CardContent, @@ -20,6 +20,23 @@ import { TabsTrigger, } from '@/shared/shadcn-ui/tabs'; +const tabs = [ + { + label: 'auth.bonusClient', + type: 'bonus' as const, + title: 'auth.bonusLogin.title', + description: 'auth.bonusLogin.description', + Icon: User, + }, + { + label: 'auth.corporateClient', + type: 'corporate' as const, + title: 'auth.corporateLogin.title', + description: 'auth.corporateLogin.description', + Icon: Building2, + }, +]; + export default function LoginPage() { const { t } = useLanguage(); @@ -34,49 +51,40 @@ export default function LoginPage() {

{t('auth.title')}

-

- {t('auth.description')} -

+

{t('auth.description')}

-
+
- - - {t('auth.bonusClient')} - - - {t('auth.corporateClient')} - + + {tabs.map((tab) => { + return ( + + {t(tab.label)} + + ); + })} - - - - {t('auth.bonusLogin.title')} - - {t('auth.bonusLogin.description')} - - - - - - - - - - - - {t('auth.corporateLogin.title')} - - {t('auth.corporateLogin.description')} - - - - - - - + {tabs.map((tab) => { + return ( + + + + {t(tab.title)} + {t(tab.description)} + + + + + + + ); + })}
@@ -92,4 +100,4 @@ export default function LoginPage() {
); -} \ No newline at end of file +} diff --git a/src/shared/components/submit-button.tsx b/src/shared/components/submit-button.tsx index ef9db2d..05df229 100644 --- a/src/shared/components/submit-button.tsx +++ b/src/shared/components/submit-button.tsx @@ -1,14 +1,18 @@ +'use client'; + import { Loader2Icon } from 'lucide-react'; import { Button, type ButtonProps } from '@/shared/shadcn-ui/button'; +import { useLanguage } from '../language'; + interface SubmitButtonProps extends ButtonProps { title?: string; isLoading: boolean; } export const SubmitButton = ({ - title = 'Отправить', + title = 'common.buttons.login', size = 'default', type = 'submit', className, @@ -17,6 +21,8 @@ export const SubmitButton = ({ onClick, ...props }: SubmitButtonProps) => { + const { t } = useLanguage(); + return ( );