diff --git a/src/components/CreateModal/CreateModal.jsx b/src/components/CreateModal/CreateModal.jsx index 88421db..08f047a 100644 --- a/src/components/CreateModal/CreateModal.jsx +++ b/src/components/CreateModal/CreateModal.jsx @@ -6,13 +6,11 @@ import { Flex, FormLabel, Input, - Switch, useDisclosure, Modal, ModalOverlay, ModalContent, FormControl, - FormHelperText, Text, Step, StepDescription, @@ -42,6 +40,7 @@ import Calendar from "react-calendar"; import "./Calendar.css"; import img_placeholder from "../../assets/images/img_placeholder.jpeg"; import TypeSelector from "../TypeSelector/TypeSelector"; +import LostFoundSwitch from "./LostFoundSwitch"; export default function CreateModal({ newAddedItem, @@ -145,12 +144,21 @@ export default function CreateModal({ fontWeight="bold" borderRadius={20} onClick={() => { - setIsEdit(isEdit); - setNewAddedItem((prev) => ({ ...prev, islost: true })); - setIsCreate(true); - setIsEdit(false); - setPosition(centerPosition); - setUploadImg(""); + { + setNewAddedItem({ + image: "", + type: "", + islost: true, + name: "", + description: "", + itemDate: "", + }); + setUploadImg(""); + setActiveStep(0); + setIsCreate(true); + setIsEdit(false); + onClose(); + } }} > Cancel @@ -173,14 +181,19 @@ export default function CreateModal({ setIsEdit(false); onClose(); }} - size="4xl" + size={"4xl"} closeOnOverlayClick={false} > {/* stepper */} - + {steps.map((step, index) => ( @@ -202,17 +215,24 @@ export default function CreateModal({ {/* steppper */} - + {/* first step */} {activeStep === 0 && ( - + - Enter your item below: + 🔑 Item Name: setNewAddedItem((prev) => ({ @@ -221,10 +241,15 @@ export default function CreateModal({ })) } /> + + 📝Description of Item: + +