diff --git a/client/src/App.js b/client/src/App.js
index 6fabda93..5f2ee671 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -3,10 +3,11 @@ import Modal from "features/modal/Modal";
import RejectionModal from "features/modal/RejectionModal";
import WelcomeUserModal from "features/modal/WelcomeUserModal";
import { useAuthContext } from "contexts/AuthContext";
+import FormProvider from "contexts/FormContext";
import LandingPage from "pages/LandingPage";
import CalendarPage from "pages/CalendarPage";
import { AdminDashboard } from "pages/AdminDashboard";
-import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
+import { Routes, Route } from "react-router-dom";
function App() {
const auth = useAuthContext();
@@ -38,7 +39,14 @@ function App() {
<>
} />
- } />
+
+
+
+ }
+ />
} />
{isAuthenticated && (
diff --git a/client/src/contexts/FormContext/useProvideForm.js b/client/src/contexts/FormContext/useProvideForm.js
index 5fb9ead1..fd3d33d0 100644
--- a/client/src/contexts/FormContext/useProvideForm.js
+++ b/client/src/contexts/FormContext/useProvideForm.js
@@ -15,6 +15,13 @@ const useProvideForm = () => {
const [formCreateEventErrors, setFormCreateEventErrors] = useState([]);
const [formScheduleEventErrors, setFormScheduleEventErrors] = useState([]);
+ const resetForm = () => {
+ if (currentStep === 4) {
+ setFormData({ recurring: { rate: "noRecurr", days: [] } });
+ setCurrentStep(1);
+ }
+ };
+
const handleNewStep = async direction => {
const newStep = direction === "next" ? currentStep + 1 : currentStep - 1;
@@ -62,6 +69,7 @@ const useProvideForm = () => {
setFormCreateEventErrors,
setFormScheduleEventErrors,
setCurrentStep,
+ resetForm,
};
};
diff --git a/client/src/features/form/FormCreateEvent.js b/client/src/features/form/FormCreateEvent.js
index e8c05320..f84df7e9 100644
--- a/client/src/features/form/FormCreateEvent.js
+++ b/client/src/features/form/FormCreateEvent.js
@@ -21,7 +21,7 @@ export default function FormCreateEvent() {
{formCreateEventErrors.map((error, index) => {
return (
-
+