From c903db439d723c7ecf3c4f8ff1f18866ee76f480 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 22 May 2026 15:59:38 +0500 Subject: [PATCH] fix(auth): enable register tab switching --- .../auth-password/ui/AuthPasswordForm.tsx | 7 ++++--- client/src/pages/auth/ui/AuthPage.tsx | 10 +++++++++- server/prisma/prisma/dev.db | Bin 364544 -> 364544 bytes 3 files changed, 13 insertions(+), 4 deletions(-) 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 bda9e909e472e53a36d16d1315c6430116ae9c26..27d8a10eeabcc1bb415aafeacaf59a985741f676 100644 GIT binary patch delta 333 zcmZozAl9%zY=Sgn(L@<%#-fc0OZs`3_%Ac?U*>_cHU}1#1|BA!j|{wK zJRkW)_~!$i^^nKanTf~VkO2Y^c4PtVFaX(+W}07NSzex(TacJ-VQOILke-{EnWLAS z53zL$*w!iA&Car%Q{rOcKgz)WnExpMqs;;h(fre6V^}z+7yV}mR+445XN0*Q!)zuQ QW_!-*x9eFXm#|I%09O2HLjV8( delta 274 zcmZozAl9%zY=Sgn!9*En#)6FrOZs^j`Cl>czv92d-_GB@Sx4)Xt2*ga=U(IKhYS_-=z;uw`+LDpm-V}&AImJ1F zfR!~lw;;XPB)d4nz`!8QxX2*esHifjs>HIu(8$=tlyRQFt)3%<+_r%66~7pE#oHWM zSQ>a3dCeGj&G@JAiSW+{x=@XGyV+Tmb4px{{Er#