diff --git a/client/src/features/auth-password/ui/AuthPasswordForm.tsx b/client/src/features/auth-password/ui/AuthPasswordForm.tsx index 4f3d311..7069893 100644 --- a/client/src/features/auth-password/ui/AuthPasswordForm.tsx +++ b/client/src/features/auth-password/ui/AuthPasswordForm.tsx @@ -29,10 +29,11 @@ type FormValues = { type Props = { isRegister: boolean + onRegisterChange: (v: boolean) => void onSuccess: () => void } -export function AuthPasswordForm({ isRegister, onSuccess }: Props) { +export function AuthPasswordForm({ isRegister, onRegisterChange, onSuccess }: Props) { const { register, watch } = useForm({ defaultValues: { email: '', password: '', passwordConfirm: '', displayName: '' }, mode: 'onChange', @@ -79,7 +80,7 @@ export function AuthPasswordForm({ isRegister, onSuccess }: Props) { pb: 0.5, textTransform: 'none', }} - disabled + onClick={() => onRegisterChange(false)} > Вход @@ -94,7 +95,7 @@ export function AuthPasswordForm({ isRegister, onSuccess }: Props) { pb: 0.5, textTransform: 'none', }} - disabled + onClick={() => onRegisterChange(true)} > Регистрация diff --git a/client/src/pages/auth/ui/AuthPage.tsx b/client/src/pages/auth/ui/AuthPage.tsx index aeeed89..470fa3d 100644 --- a/client/src/pages/auth/ui/AuthPage.tsx +++ b/client/src/pages/auth/ui/AuthPage.tsx @@ -20,6 +20,7 @@ export function AuthPage() { const [message, setMessage] = useState(null) const [oauthError, setOauthError] = useState(null) const [tab, setTab] = useState(0) + const [isRegister, setIsRegister] = useState(false) const [showForgot, setShowForgot] = useState(false) const [searchParams, setSearchParams] = useSearchParams() const navigate = useNavigate() @@ -122,6 +123,7 @@ export function AuthPage() { }} onClick={() => { setTab(idx) + if (idx === 0) setIsRegister(false) setMessage(null) setOauthError(null) }} @@ -142,7 +144,13 @@ export function AuthPage() { )} - {tab === 0 && navigate('/', { replace: true })} />} + {tab === 0 && ( + navigate('/', { replace: true })} + /> + )} {tab === 1 && navigate('/', { replace: true })} />} diff --git a/server/prisma/prisma/dev.db b/server/prisma/prisma/dev.db index bda9e90..27d8a10 100644 Binary files a/server/prisma/prisma/dev.db and b/server/prisma/prisma/dev.db differ