From 1ad9b782a47b7020e20a1c08571fd35027076d85 Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Tue, 26 Aug 2025 12:24:56 +0530 Subject: [PATCH] added lodering status when making request for demo --- src/pages/authentication/RegisterPage.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/authentication/RegisterPage.jsx b/src/pages/authentication/RegisterPage.jsx index b03ff1a8..bf38015c 100644 --- a/src/pages/authentication/RegisterPage.jsx +++ b/src/pages/authentication/RegisterPage.jsx @@ -37,6 +37,7 @@ const registerSchema = z.object({ const RegisterPage = () => { const [registered, setRegristered] = useState(false); const [industries, setIndustries] = useState([]); + const [Loading,setLoading] = useState(false) const { register, handleSubmit, @@ -47,11 +48,14 @@ const RegisterPage = () => { const onSubmit = async (data) => { try { + setLoading(true) const response = await MarketRepository.requestDemo(data); - showToast("Your Registration SuccessFully !"); + showToast("Your request has been sent successfully. Please stay in touch!"); setRegristered(true); + setLoading(false) } catch (error) { showToast(error.message, "error"); + setLoading(false) } }; useEffect(() => { @@ -286,7 +290,7 @@ const RegisterPage = () => { aria-label="Click me " className="btn btn-primary d-grid w-100" > - Request Demo + {Loading ? "Please Wait..." :" Request Demo"} @@ -296,6 +300,7 @@ const RegisterPage = () => { aria-label="Go to Login Page" to="/auth/login" className="text-decoration-underline ms-1" + disabled={Loading} > Back to login