fix: forms fix for mobiles

This commit is contained in:
2025-08-11 11:00:57 +04:00
parent 6caac5743b
commit 3560afabcc
3 changed files with 11 additions and 7 deletions

View File

@ -27,7 +27,7 @@ const VerifyPhoneForm: FC = () => {
const authState = useSelector((state: RootState) => state.auth); const authState = useSelector((state: RootState) => state.auth);
const handleSubmit = (values: VerifyNumberForm) => { const handleSubmit = (values: VerifyNumberForm) => {
if (!authState.phoneNumber || !authState.loginChallenge) return; if (!authState.phoneNumber || !authState.loginChallenge) return;
console.log(authState.phoneNumber.replace(/ /g, "")); console.log(authState.phoneNumber.replace(/ /g, ""));
@ -55,8 +55,10 @@ const VerifyPhoneForm: FC = () => {
const navigateToLogin = () => redirect("/"); const navigateToLogin = () => redirect("/");
return ( return (
<form onSubmit={form.onSubmit(handleSubmit)}> <form
<Stack> style={{ justifyItems: "center" }}
onSubmit={form.onSubmit(handleSubmit)}>
<Stack maw={500}>
<PinInput <PinInput
length={6} length={6}
placeholder="_" placeholder="_"

View File

@ -6,11 +6,11 @@ import { Button, Stack } from "@mantine/core";
import { useForm } from "@mantine/form"; import { useForm } from "@mantine/form";
import { Auth } from "@/client"; import { Auth } from "@/client";
import PhoneInput from "@/components/ui/PhoneInput/PhoneInput"; import PhoneInput from "@/components/ui/PhoneInput/PhoneInput";
import { notifications } from "@/lib/notifications";
import { import {
setLoginChallenge, setLoginChallenge,
setPhoneNumber, setPhoneNumber,
} from "@/lib/store/features/auth/authSlice"; } from "@/lib/store/features/auth/authSlice";
import { notifications } from "@/lib/notifications";
import { useAppDispatch } from "@/lib/store/store"; import { useAppDispatch } from "@/lib/store/store";
type LoginForm = { type LoginForm = {
@ -69,8 +69,10 @@ const LoginForm: FC<Props> = ({ loginChallenge, isCreatingId = false }) => {
const navigateToLogin = () => router.push("/"); const navigateToLogin = () => router.push("/");
return ( return (
<form onSubmit={form.onSubmit(handleSubmit)}> <form
<Stack> style={{ justifyItems: "center" }}
onSubmit={form.onSubmit(handleSubmit)}>
<Stack maw={500}>
<PhoneInput <PhoneInput
{...form.getInputProps("phoneNumber")} {...form.getInputProps("phoneNumber")}
setPhoneMask={setPhoneMask} setPhoneMask={setPhoneMask}

View File

@ -32,7 +32,7 @@ const Logo = ({ title }: Props) => {
<Title <Title
order={4} order={4}
mb={"lg"} mb={"lg"}
style={{ color: myColor[6] }}> style={{ color: myColor[6], textAlign: "center" }}>
{title} {title}
</Title> </Title>
</Center> </Center>