Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a close button, in UserForm.js #333

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/src/features/form/UserForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import FormCreateEvent from "./FormCreateEvent";
import FormScheduleEvent from "./FormScheduleEvent";
import FormConfirm from "./FormConfirm";
import FormSuccess from "./FormSuccess";
import { useFormModalContext } from "contexts/FormModalContext";

// This is the code for the form where you add events to the calendar
const UserForm = () => {

// Specifically extract the currentStep and totalSteps from userFormContext
const { currentStep, totalSteps } = useFormContext();

const modal = useFormModalContext();


// Called to display different parts of the form based on the latest step.
const displayStep = step => {
switch (step) {
Expand All @@ -34,6 +38,14 @@ const UserForm = () => {
return (
<div className="md:w mx-auto shadow-xl rounded-2xl pb-2 bg-white">
<div className="container horizontal mt-5">
<div className="flex flex-col items-center">
<button
className="w-auto h-12 mt-5 px-2 border-solid border-2 border-gray outline-none rounded font-semibold text-xl hover:bg-teal-600 active:bg-teal-700 focus:outline-none focus:ring focus:ring-teal-300"
onClick={modal.handleClose}
>
Close
</button>
</div>
<FormMover />

<div className="my-1 p-5">
Expand Down