From 2c6b1d07f453f1479b893a679f88c2bbbee1a1a6 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 27 Nov 2024 11:30:59 +0800 Subject: [PATCH] Add loading button --- Client/src/Pages/Auth/Login.jsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index ece5de314..799fa8ae8 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -4,6 +4,7 @@ import { Box, Button, Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import { credentials } from "../../Validation/validation"; import { login } from "../../Features/Auth/authSlice"; +import LoadingButton from "@mui/lab/LoadingButton"; import { useDispatch, useSelector } from "react-redux"; import { createToast } from "../../Utils/toastUtils"; import { networkService } from "../../main"; @@ -231,6 +232,7 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { const theme = useTheme(); const navigate = useNavigate(); const inputRef = useRef(null); + const authState = useSelector((state) => state.auth); useEffect(() => { if (inputRef.current) { @@ -302,10 +304,11 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { Back - + */} + + {"Continue"} + { const [errors, setErrors] = useState({}); const [step, setStep] = useState(0); + useEffect(() => {}, [authState.isLoading]); + useEffect(() => { if (authToken) { navigate("/monitors");