source: imaps-frontend/src/components/Modals/RoomModal/RoomModal.jsx@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[0c6b92a]1import React, {useState, useEffect} from "react";
2import ModalNameField from "../Components/ModalNameField.jsx";
3import ModalDescriptionField from "../Components/ModalDescriptionField.jsx";
4import ModalSaveButton from "../Components/ModalSaveButton.jsx";
5import Modal from "../Components/Modal.jsx";
6import ModalRoomTypes from "../Components/ModalRoomTypes.jsx";
7import useModalState from "../Hooks/useModalState.jsx";
8import {useModalEvent} from "../Hooks/useModalEvent.jsx";
[79a0317]9import ModalUploadRoomImage from "../Components/ModalUploadRoomImage.jsx";
[0c6b92a]10
11export default function RoomModal({map,roomTypes}) {
12 const {
13 modalState: {isOpen,setIsOpen,setShape,shapeInfo,setShapeInfo},
14 handlers: {toggleModal,updateModalData,saveDetails}
15 } = useModalState(map);
16
17
18 useModalEvent((event) => {
19 const shape = event.detail.room;
20 setShape(shape);
21 setShapeInfo(shape.info);
22 setIsOpen(true);
[79a0317]23 event.detail.map.detachKeyPressEventListeners();
[0c6b92a]24
25 },"openRoomModalEvent")
26
27
28
29 return (
30 <Modal isOpen={isOpen} toggleModal={toggleModal} title={"Enter Room Details"}>
31 <ModalNameField shapeInfo={shapeInfo} updateModalData={updateModalData}/>
32 <ModalRoomTypes updateModalData={updateModalData} shapeInfo={shapeInfo} roomTypes={roomTypes}/>
33 <ModalDescriptionField shapeInfo={shapeInfo} updateModalData={updateModalData}/>
[79a0317]34 <ModalUploadRoomImage></ModalUploadRoomImage>
[0c6b92a]35 <ModalSaveButton saveDetails={saveDetails}/>
36 </Modal>
37 );
38}
Note: See TracBrowser for help on using the repository browser.