From e6f7a685d6cf228a5d02a971283f2463c44206b6 Mon Sep 17 00:00:00 2001 From: Dang Nguyen Nguyen Date: Wed, 6 Sep 2023 11:54:07 -0700 Subject: [PATCH] createmodal-mobile --- src/components/CreateModal/CreateModal.jsx | 188 ++++++++++++------ .../CreateModal/LostFoundSwitch.jsx | 56 ++++++ src/components/Type/TypeCard.jsx | 11 +- src/components/TypeSelector/TypeSelector.jsx | 6 +- 4 files changed, 196 insertions(+), 65 deletions(-) create mode 100644 src/components/CreateModal/LostFoundSwitch.jsx 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: + +