diff --git a/client/src/components/SignUpModule.tsx b/client/src/components/SignUpModule.tsx index 1a216cb..65f1fb8 100644 --- a/client/src/components/SignUpModule.tsx +++ b/client/src/components/SignUpModule.tsx @@ -6,6 +6,7 @@ import config from "../config"; import NextUIFormikInput from "./NextUIFormikInput"; import { useNavigate } from "react-router-dom"; import { popErrorToast } from "../utilities"; +import { useState } from "react"; const validationSchema = Yup.object({ firstName: Yup.string() @@ -47,6 +48,7 @@ const validationSchema = Yup.object({ export default function SignUpModule() { const navigate = useNavigate(); + const [step, setStep] = useState(1); const initialValues = { firstName: "", @@ -64,11 +66,15 @@ export default function SignUpModule() { values ); console.log("User created successfully:", response.data); + navigate("/signin"); } catch (error) { popErrorToast(error); } }; + const nextStep = () => setStep((prev) => prev + 1); + const prevStep = () => setStep((prev) => prev - 1); + return (
{({ isValid, dirty }) => (
- - - - - +65 + {step === 1 && ( + <> +

+ First, let us know how to address you.

- } - /> - -
- - I have read and agreed to the{" "} - Terms and Services - - -
- + + + + + )} + {step === 2 && ( + <> +

+ Nice to meet you! Next, your contacts. +

+ + + +65 +

+ } + /> +
+ + +
+ + )} + {step === 3 && ( + <> +

+ Almost there! Now, a strong password please. +

+ +
+ + I have read and agreed to the{" "} + Terms and Services + + +
+
+ + +
+ + )} )}