This commit is contained in:
Estifo77
2026-08-19 10:31:13 +03:00
parent 0832e5d339
commit 9185df64b9
2 changed files with 22 additions and 28 deletions

View File

@@ -29,7 +29,7 @@ import { useNavigate, Link } from 'react-router-dom';
import { useDispatch } from 'react-redux';
import { useTranslation } from 'react-i18next';
import { useApiMutation } from '@ema-platform/api';
import { useErrorHandler, passwordSchema, PasswordRequirements, joinPersonName } from '@ema-platform/ui';
import { useErrorHandler, passwordSchema, PasswordRequirements } from '@ema-platform/ui';
import { AuthShell } from '../components/AuthShell';
import { loginSuccess, setUser } from '../store/auth.slice';
import type { AuthUser } from '../types/auth.types';
@@ -124,7 +124,7 @@ export function SignupPage() {
username: values.username,
phoneNumber: values.phoneNumber,
userType: values.userType,
name: { en: joinPersonName(values), am: values.nameAm ?? '' },
name: { en: values.nameEn, am: values.nameAm ?? '' },
password: values.password,
confirmPassword: values.confirmPassword,
};
@@ -213,38 +213,23 @@ export function SignupPage() {
<form onSubmit={handleSubmit(onSubmit)}>
<Stack gap="md">
<SimpleGrid cols={{ base: 1, sm: 3 }} spacing="md">
<TextInput
label={t('signup.firstNameLabel', 'First name')}
placeholder={t('signup.firstNamePlaceholder', 'Abebe')}
leftSection={<IconUser size={18} />}
error={errors.firstName?.message}
{...register('firstName')}
/>
<SimpleGrid cols={{ base: 1, xs: 2 }} spacing="md">
<TextInput
label={t('signup.nameEnLabel', 'Full name (English)')}
placeholder={t('signup.nameEnPlaceholder', 'Abebe Bekele')}
leftSection={<IconUser size={18} />}
error={errors.middleName?.message}
{...register('middleName')}
error={errors.nameEn?.message}
{...register('nameEn')}
/>
<TextInput
label={t('signup.lastNameLabel', 'Last name')}
placeholder={t('signup.lastNamePlaceholder', 'Bekele')}
label={t('signup.nameAmLabel', 'Name (Amharic)')}
placeholder={t('signup.nameAmPlaceholder', 'ስም')}
leftSection={<IconUser size={18} />}
error={errors.lastName?.message}
{...register('lastName')}
error={errors.nameAm?.message}
{...register('nameAm')}
/>
</SimpleGrid>
<TextInput
label={t('signup.nameAmLabel', 'Name (Amharic)')}
placeholder={t('signup.nameAmPlaceholder', 'ስም')}
leftSection={<IconUser size={18} />}
error={errors.nameAm?.message}
{...register('nameAm')}
/>
<SimpleGrid cols={{ base: 1, xs: 2 }} spacing="md">
<TextInput
label={t('signup.emailLabel', 'Email address')}