source: frontend/src/Components/HotelEdit/HotelEditTab.js@ 5528b99

Last change on this file since 5528b99 was 5528b99, checked in by darsov2 <62809499+darsov2@…>, 9 months ago

revert

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[e6c2521]1import React from "react";
[5528b99]2import { Container, Col, Row, Image, Nav, Tab } from "react-bootstrap";
3import { useState } from "react";
4import { FaTaxi, FaHotel } from "react-icons/fa";
5import { MdOutlineStickyNote2 } from "react-icons/md";
[e6c2521]6import AddNew from "../Resources/AddNew";
[5528b99]7import { BiData } from "react-icons/bi"
[e6c2521]8import RoomListing from "./RoomListing";
9import HotelEditForm from "./HotelEditForm";
10import AddHotelForm from "../Forms/AddHotelForm";
11import EditModal from "../Resources/EditModal";
12
13function HotelEditTab(props) {
[5528b99]14 const [activeTab, setActiveTab] = useState("/hotel");
15 const [modalData, setModalData] = useState("");
16 const [show, setShow] = useState(false);
[e6c2521]17
[5528b99]18 const handleClose = () => setShow(false);
19 const handleShow = () => {
20 //e.preventDefault();
21 setShow(true);
[e6c2521]22
[5528b99]23 };
[e6c2521]24
[5528b99]25 const showModal = (modalData) => {
26 setModalData(modalData);
27 handleShow();
28 }
29 console.log(props.displayRoom)
[e6c2521]30
[5528b99]31 const handleSelect = (eventKey) => {
32 setActiveTab(eventKey);
33 };
[e6c2521]34
[5528b99]35 return (
36 <Container className="rounded-5">
37 <Tab.Container
38 activeKey={activeTab}
39 onSelect={handleSelect}
40 className="bg-dark rounded-5"
41 >
42 <Nav
43 fill
44 variant="tabs"
45 className="bg-body rounded-top-5"
46 activeKey="/hotel"
47 id="tab_item"
48 >
49 <Nav.Item className="tab_item rounded-5">
50 <Nav.Link eventKey="/hotel" className="text-left rounded-5">
[e6c2521]51 <span className="ikona">
52 <FaHotel
[5528b99]53 color="#159895"
54 style={{ lineHeight: "100em" }}
55 size={"1.5em"}
56 className="mx-3"
[e6c2521]57 />
58 </span>
[5528b99]59 <span className="ikona">Соби</span>
60 </Nav.Link>
61 </Nav.Item>
62 <Nav.Item className="tab_item">
63 <Nav.Link eventKey="/restaurant">
[e6c2521]64 <span className="ikona">
[5528b99]65 <MdOutlineStickyNote2 color="#159895" size={"1.5em"} className="mx-3" />
[e6c2521]66 </span>
[5528b99]67 <span className="ikona">Резервации</span>
68 </Nav.Link>
69 </Nav.Item>
70 <Nav.Item className="tab_item rounded-5">
71 <Nav.Link eventKey="/transport" className="text-left rounded-5">
[e6c2521]72 <span className="ikona">
[5528b99]73 <BiData color="#159895" size={"1.5em"} className="mx-3" />
[e6c2521]74 </span>
[5528b99]75 <span className="ikona">Општи податоци</span>
76 </Nav.Link>
77 </Nav.Item>
78 </Nav>
[e6c2521]79
[5528b99]80 <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light">
81 <Tab.Pane eventKey="/hotel">
82 {props.displayRoom.hotelRooms.map((room) => {
83 return <RoomListing key={room.hotelRoomId} data={room} showModal={showModal}/>
84 })}
85 <EditModal show={show} handleClose={handleClose} type="room" room={modalData}></EditModal>
86 <AddNew Id={props.displayRoom.hotelId} refresh={props.refresh} type="room"/>
87 </Tab.Pane>
88 <Tab.Pane eventKey="/restaurant">
89 <AddNew type="restaurant"/>
90 </Tab.Pane>
91 <Tab.Pane eventKey="/transport">
92 <AddHotelForm refresh={props.refresh} hotel={props.displayRoom}/>
93 </Tab.Pane>
94 </Tab.Content>
95 </Tab.Container>
96 </Container>
97 );
[e6c2521]98}
99
100export default HotelEditTab;
Note: See TracBrowser for help on using the repository browser.