From b58fe4ae74bd18fed1916d687e2b1f3ecfe51b46 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 12 Jun 2025 09:04:19 +0800 Subject: [PATCH] add loading state --- client/src/Pages/Auth/Register/index.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/Pages/Auth/Register/index.jsx b/client/src/Pages/Auth/Register/index.jsx index 2dd0951dd..97b27e5cf 100644 --- a/client/src/Pages/Auth/Register/index.jsx +++ b/client/src/Pages/Auth/Register/index.jsx @@ -11,7 +11,7 @@ import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; import { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { useParams } from "react-router-dom"; import { networkService } from "../../../main"; import { newOrChangedCredentials } from "../../../Validation/validation"; @@ -35,6 +35,9 @@ const getFeedbackStatus = (form, errors, field, criteria) => { }; const Register = ({ superAdminExists }) => { + // Redux + const { isLoading } = useSelector((state) => state.auth); + // Local state const [form, setForm] = useState({ firstName: "", @@ -203,6 +206,8 @@ const Register = ({ superAdminExists }) => { alignItems="center" gap={theme.spacing(10)} > + {t("auth.registration.heading.user")} + { />