diff --git a/server/prisma/test.db b/server/prisma/test.db index 2529006..0764957 100644 Binary files a/server/prisma/test.db and b/server/prisma/test.db differ diff --git a/src/components/InitializeAccount.tsx b/src/components/InitializeAccount.tsx index 956fd96..ac5f345 100644 --- a/src/components/InitializeAccount.tsx +++ b/src/components/InitializeAccount.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import { initializeAccount } from '../services/auth'; import { User, Language } from '../types'; -import { Globe, ArrowRight, Check } from 'lucide-react'; +import { Globe, ArrowRight, Check, Calendar } from 'lucide-react'; +import { DatePicker } from './ui/DatePicker'; import { t } from '../services/i18n'; interface InitializeAccountProps { @@ -16,7 +17,7 @@ const InitializeAccount: React.FC = ({ onInitialized, la const [birthDate, setBirthDate] = useState(''); const [height, setHeight] = useState(''); const [weight, setWeight] = useState(''); - const [gender, setGender] = useState<'MALE' | 'FEMALE' | 'OTHER' | ''>(''); + const [gender, setGender] = useState<'MALE' | 'FEMALE' | 'OTHER'>('MALE'); const handleInitialize = async () => { setIsSubmitting(true); @@ -91,16 +92,13 @@ const InitializeAccount: React.FC = ({ onInitialized, la
-
- - setBirthDate(e.target.value)} - className="w-full p-4 rounded-2xl bg-surface-container-high border border-outline-variant/30 text-on-surface focus:border-primary focus:outline-none transition-all" - /> -
+ setBirthDate(val)} + maxDate={new Date()} + testId="init-birth-date" + />
@@ -114,7 +112,7 @@ const InitializeAccount: React.FC = ({ onInitialized, la />
- + = ({ onInitialized, la onChange={(e) => setGender(e.target.value as any)} className="w-full p-4 rounded-2xl bg-surface-container-high border border-outline-variant/30 text-on-surface focus:border-primary focus:outline-none transition-all appearance-none" > - diff --git a/src/components/Profile.tsx b/src/components/Profile.tsx index cc03ae0..293a00d 100644 --- a/src/components/Profile.tsx +++ b/src/components/Profile.tsx @@ -302,7 +302,7 @@ const Profile: React.FC = ({ user, onLogout, lang, onLanguageChang

{t('personal_data', lang)}

- + = ({ tracker, lang }) => {
= ({ if (textInputValue && validateDateInput(textInputValue)) { onChange(textInputValue); setTextInputValue(''); + setIsOpen(false); + (e.target as HTMLInputElement).blur(); + } else if (!textInputValue) { + setIsOpen(false); (e.target as HTMLInputElement).blur(); } } + if (e.key === 'Escape') { + setIsOpen(false); + setTextInputValue(''); + setTextInputError(''); + (e.target as HTMLInputElement).blur(); + } }} placeholder={placeholder} disabled={disabled} diff --git a/src/services/i18n.ts b/src/services/i18n.ts index c5dff88..0c014a9 100644 --- a/src/services/i18n.ts +++ b/src/services/i18n.ts @@ -51,7 +51,7 @@ const translations = { // Tracker ready_title: 'Ready?', ready_subtitle: 'Start your workout and break records.', - my_weight: 'My Weight (kg)', + bodyweight: 'Bodyweight (kg)', change_in_profile: 'Change in profile', last_workout_today: 'Last workout: Today', days_off: 'Days off training:', @@ -275,7 +275,7 @@ const translations = { // Tracker ready_title: 'Готовы?', ready_subtitle: 'Начните тренировку и побейте рекорды.', - my_weight: 'Мой вес (кг)', + bodyweight: 'Вес тела (кг)', change_in_profile: 'Можно изменить в профиле', last_workout_today: 'Последняя тренировка: Сегодня', days_off: 'Дней без тренировок:', diff --git a/tests/01_core_auth.spec.ts b/tests/01_core_auth.spec.ts index 54eebed..b1cf83a 100644 --- a/tests/01_core_auth.spec.ts +++ b/tests/01_core_auth.spec.ts @@ -202,8 +202,9 @@ test.describe('I. Core & Authentication', () => { // Fill data await page.getByLabel(/Birth Date|Дата рожд./i).fill('1990-01-01'); + await page.keyboard.press('Enter'); await page.getByLabel(/Height|Рост/i).fill('180'); - await page.getByLabel(/Weight|Мой вес/i).fill('80'); + await page.getByLabel(/Bodyweight|Вес тела/i).fill('80'); await page.getByLabel(/Gender|Пол/i).selectOption('MALE'); await page.getByRole('button', { name: /Get Started|Начать работу/i }).click();