fix(auth): i18n и react-hook-form на странице логина

Добавлены i18next, схема zod и react-hook-form для формы входа.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-13 17:54:00 +03:00
parent 755d22cf48
commit fd825ddfd7
8 changed files with 2865 additions and 66 deletions
+30
View File
@@ -0,0 +1,30 @@
import React, { useEffect } from 'react';
import { ConfigProvider } from 'antd';
import ruRU from 'antd/locale/ru_RU';
import enUS from 'antd/locale/en_US';
import dayjs from 'dayjs';
import 'dayjs/locale/ru';
import 'dayjs/locale/en';
import { useTranslation } from 'react-i18next';
import { useAuthStore } from '../store/authStore';
const antdLocales = { ru: ruRU, en: enUS } as const;
const LocaleProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const { i18n } = useTranslation();
const language = useAuthStore((s) => s.user?.language);
const locale = language === 'en' ? 'en' : 'ru';
useEffect(() => {
void i18n.changeLanguage(locale);
dayjs.locale(locale);
}, [i18n, locale]);
return (
<ConfigProvider locale={antdLocales[locale]}>
{children}
</ConfigProvider>
);
};
export default LocaleProvider;