Добавлены новые зависимости: "react-select" и "@floating-ui/core". Реализована локализация с использованием i18next, добавлены переводы для английского и русского языков. Обновлены компоненты для поддержки локализации, включая AppHeader, Attendance, Dashboard и другие. Улучшена логика отображения данных и взаимодействия с пользователем.

This commit is contained in:
2025-03-23 11:41:29 +03:00
parent d5b5838e51
commit d3a7f70d12
27 changed files with 995 additions and 191 deletions
@@ -16,6 +16,7 @@ import {
Input,
} from '@chakra-ui/react'
import { AddIcon } from '@chakra-ui/icons'
import { useTranslation } from 'react-i18next'
import { dateToCalendarFormat } from '../../../utils/time'
import { Lesson } from '../../../__data__/model'
@@ -45,6 +46,8 @@ export const LessonForm = ({
title,
nameButton,
}: LessonFormProps) => {
const { t } = useTranslation()
const getNearestTimeSlot = () => {
const now = new Date();
const minutes = now.getMinutes();
@@ -96,21 +99,21 @@ export const LessonForm = ({
<Controller
control={control}
name="date"
rules={{ required: 'Обязательное поле' }}
rules={{ required: t('journal.pl.common.required') }}
render={({ field }) => (
<FormControl>
<FormLabel>Дата</FormLabel>
<FormLabel>{t('journal.pl.lesson.form.date')}</FormLabel>
<Input
{...field}
required={false}
placeholder="Укажите дату лекции"
placeholder={t('journal.pl.lesson.form.datePlaceholder')}
size="md"
type="datetime-local"
/>
{errors.date ? (
<FormErrorMessage>{errors.date?.message}</FormErrorMessage>
) : (
<FormHelperText>Укажите дату и время лекции</FormHelperText>
<FormHelperText>{t('journal.pl.lesson.form.dateTime')}</FormHelperText>
)}
</FormControl>
)}
@@ -119,14 +122,14 @@ export const LessonForm = ({
<Controller
control={control}
name="name"
rules={{ required: 'Обязательное поле' }}
rules={{ required: t('journal.pl.common.required') }}
render={({ field }) => (
<FormControl isRequired isInvalid={Boolean(errors.name)}>
<FormLabel>Название новой лекции:</FormLabel>
<FormLabel>{t('journal.pl.lesson.form.title')}</FormLabel>
<Input
{...field}
required={false}
placeholder="Название лекции"
placeholder={t('journal.pl.lesson.form.namePlaceholder')}
size="md"
/>
{errors.name && (