added lodering status when making request for demo
This commit is contained in:
parent
5dfaa6d44c
commit
1ad9b782a4
@ -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"}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@ -296,6 +300,7 @@ const RegisterPage = () => {
|
||||
aria-label="Go to Login Page"
|
||||
to="/auth/login"
|
||||
className="text-decoration-underline ms-1"
|
||||
disabled={Loading}
|
||||
>
|
||||
<i className="bx bx-chevron-left scaleX-n1-rtl bx-sm me-1"></i>
|
||||
Back to login
|
||||
|
Loading…
x
Reference in New Issue
Block a user