From 998ca26b048890a352c5a210569257c2f6ef44e8 Mon Sep 17 00:00:00 2001 From: Anuarbek Zhakhangir Date: Mon, 1 Sep 2025 20:58:07 +0900 Subject: [PATCH] feat: disable registration for FightForm and update UI accordingly --- src/components/Events.tsx | 2 +- src/pages/forms/fight.tsx | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/components/Events.tsx b/src/components/Events.tsx index b5e2247..17a195b 100644 --- a/src/components/Events.tsx +++ b/src/components/Events.tsx @@ -141,7 +141,7 @@ function Events() { link="https://yukafest.ru/pilots/" /> ([]); const [isSubmitting, setIsSubmitting] = useState(false); - // Add a key to force re-render of Fileupload component const [fileUploadKey, setFileUploadKey] = useState(0); + + // Add registration disabled state + const isRegistrationDisabled = true; const { value: phoneValue, handleChange: handlePhoneChange } = usePhoneMask(); @@ -47,6 +49,11 @@ function FightFormPage() { const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); + if (isRegistrationDisabled) { + alert("Регистрация временно закрыта"); + return; + } + if (!checkboxValues.includes("terms")) { alert("Необходимо согласие на обработку персональных данных"); return; @@ -126,7 +133,15 @@ function FightFormPage() { Регистрация на Битву за Москву -
+ {isRegistrationDisabled && ( +
+

+ Регистрация временно закрыта +

+
+ )} + + - {isSubmitting ? "Отправка..." : "Отправить"} + {isRegistrationDisabled ? "Регистрация закрыта" : isSubmitting ? "Отправка..." : "Отправить"}