fixed some errors

This commit is contained in:
@jcarymuhammedow
2026-01-08 18:01:17 +05:00
parent 7538bdb813
commit 071b45b98a
15 changed files with 1809 additions and 727 deletions

View File

@@ -54,10 +54,7 @@ interface FormErrors {
file?: string;
}
export default function OpenStorePage({
locale = "ru",
translations,
}: OpenStorePageProps) {
export default function OpenStorePage({}: OpenStorePageProps) {
const [formData, setFormData] = useState<FormData>({
firstName: "",
lastName: "",
@@ -76,21 +73,21 @@ export default function OpenStorePage({
const newErrors: FormErrors = {};
if (!formData.firstName.trim()) {
newErrors.firstName = t("firstNameRequired");
newErrors.firstName = t("requiredField");
}
if (!formData.lastName.trim()) {
newErrors.lastName = t("lastNameRequired");
newErrors.lastName = t("requiredField");
}
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(formData.email)) {
newErrors.email = t("emailInvalid");
newErrors.email = t("requiredField");
}
const phoneRegex = /^\+?[0-9]{6,15}$/;
if (!phoneRegex.test(formData.phone)) {
newErrors.phone = t("phoneInvalid");
newErrors.phone = t("requiredField");
}
if (!formData.file) {