source: frontend/src/Components/TransportEdit/TransportEditTab.js@ ac19a0c

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

authContext impl, admin panel impl, search bar fixes, reservations listings impl

  • Property mode set to 100644
File size: 2.9 KB
Line 
1import React from "react";
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";
6import AddNew from "../Resources/AddNew";
7import { BiData } from "react-icons/bi";
8import AddTransportForm from "../Forms/AddTransportForm";
9import TransportListing from "./TransportListing";
10import useGet from "../Hooks/useGet";
11
12function TransportEditTab(props) {
13 const [activeTab, setActiveTab] = useState("/hotel");
14 console.log(props.displayRoute)
15
16
17 const handleSelect = (eventKey) => {
18 setActiveTab(eventKey);
19 };
20
21 return (
22 <Container className="rounded-5">
23 <Tab.Container
24 activeKey={activeTab}
25 onSelect={handleSelect}
26 className="bg-dark rounded-5"
27 >
28 <Nav
29 fill
30 variant="tabs"
31 className="bg-body rounded-top-5"
32 activeKey="/hotel"
33 id="tab_item"
34 >
35 <Nav.Item className="tab_item rounded-5">
36 <Nav.Link eventKey="/hotel" className="text-left rounded-5">
37 <span className="ikona">
38 <FaHotel
39 color="#159895"
40 style={{ lineHeight: "100em" }}
41 size={"1.5em"}
42 className="mx-3"
43 />
44 </span>
45 <span className="ikona">Рути</span>
46 </Nav.Link>
47 </Nav.Item>
48 <Nav.Item className="tab_item">
49 <Nav.Link eventKey="/restaurant">
50 <span className="ikona">
51 <MdOutlineStickyNote2 color="#159895" size={"1.5em"} className="mx-3" />
52 </span>
53 <span className="ikona">Резервации</span>
54 </Nav.Link>
55 </Nav.Item>
56 <Nav.Item className="tab_item rounded-5">
57 <Nav.Link eventKey="/transport" className="text-left rounded-5">
58 <span className="ikona">
59 <BiData color="#159895" size={"1.5em"} className="mx-3" />
60 </span>
61 <span className="ikona">Општи податоци</span>
62 </Nav.Link>
63 </Nav.Item>
64 </Nav>
65
66 <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light">
67 <Tab.Pane eventKey="/hotel">
68 {props.displayRoute && props.displayRoute.availableRoutes.map((route) => {
69 return <TransportListing data={route}/>
70 })}
71 <AddNew type="route" transport={props.displayRoute} refresh={props.refresh}/>
72 </Tab.Pane>
73 <Tab.Pane eventKey="/restaurant">
74 <AddNew type="restaurant"/>
75 </Tab.Pane>
76 <Tab.Pane eventKey="/transport">
77 <AddTransportForm transport={props.displayRoute} refresh={props.refresh}/>
78 </Tab.Pane>
79 </Tab.Content>
80 </Tab.Container>
81 </Container>
82 );
83}
84
85export default TransportEditTab;
Note: See TracBrowser for help on using the repository browser.