Changeset ac19a0c for frontend/src/Components
- Timestamp:
- 01/13/24 23:19:50 (10 months ago)
- Branches:
- master
- Children:
- e85a562
- Parents:
- e9b4ba9
- Location:
- frontend/src/Components
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Forms/AddHotelForm.js
re9b4ba9 rac19a0c 119 119 return prevState + 1; 120 120 }) 121 if(!edit) 122 props.closeModal() 121 123 }} 122 124 > -
frontend/src/Components/Forms/AddRestaurantForm.js
re9b4ba9 rac19a0c 85 85 return prevState + 1; 86 86 }) 87 props.closeModal() 87 88 }} 88 89 > -
frontend/src/Components/Forms/AddRoomForm.js
re9b4ba9 rac19a0c 13 13 hotelRoomDescription: "", 14 14 hotelRoomName: "", 15 num Beds: "",15 numOfBeds: "", 16 16 price: "", 17 17 kitchenAvailable: false, … … 58 58 type="number" 59 59 placeholder="Внесете го бројот на кревети" 60 value={formData.num Beds}61 name="num Beds"60 value={formData.numOfBeds} 61 name="numOfBeds" 62 62 onChange={onFormChange} 63 63 /> … … 117 117 style={{ backgroundColor: "#159895" }} 118 118 size="md" 119 onClick={() => { 120 console.log(formData); 119 onClick={(e) => { 120 e.preventDefault(); 121 props.refresh((prev) => { 122 return ++prev; 123 }) 121 124 createHotelRoom(formData); 125 props.closeModal(); 122 126 }} 123 127 > -
frontend/src/Components/Forms/AddTransportForm.js
re9b4ba9 rac19a0c 11 11 transportName: "", 12 12 carBrand: "", 13 carType: false,13 carType: "", 14 14 carManufacturedYear: 1900, 15 15 noPassengers: 0, … … 107 107 createTransport(formData, edit); 108 108 props.refresh((prev) => { 109 return prev + 1;109 return ++prev; 110 110 }) 111 if(!edit) 112 props.closeModal() 111 113 }} 112 114 > -
frontend/src/Components/Forms/EditRoomForm.js
re9b4ba9 rac19a0c 28 28 } = useGet(`/hotel/rooms/${props.room.hotelRoomId}/available`) 29 29 30 console.log(`/hotel/rooms/${props.room.hotelRoomId}/available`) 31 30 32 !isLoading && console.log(data) 31 33 … … 42 44 <tr> 43 45 <th>#</th> 44 <th>Достапно од</th> 45 <th>Достапно до</th> 46 <th>Број на соби</th> 46 <th>Oд</th> 47 <th>До</th> 48 <th>Време на тргнување</th> 49 <th>Време на пристигнување</th> 50 <th>Цена</th> 47 51 </tr> 48 52 </thead> -
frontend/src/Components/Hooks/Hotel/useCreateHotel.js
re9b4ba9 rac19a0c 6 6 const useCreateHotel = () => { 7 7 8 //const history = useNavigate();9 8 const createHotel = async (hotel, edit) => { 10 9 console.log({hotel}) 11 10 console.log(hotel) 11 console.log("vo createhotel") 12 12 13 13 if(!edit) … … 16 16 .post(`/hotel/add`, hotel, { 17 17 params: { 18 userId: localStorage.getItem("userId")18 userId: JSON.parse(localStorage.getItem("user")).userId 19 19 } 20 20 }) -
frontend/src/Components/Hooks/Restaurant/useCreateRestaurant.js
re9b4ba9 rac19a0c 15 15 .post(`/restaurant/add`, restaurant, { 16 16 params: { 17 userId: localStorage.getItem('userId')17 userId: JSON.parse(localStorage.getItem('user')).userId, 18 18 } 19 19 }) -
frontend/src/Components/Hooks/Transport/useCreateTransport.js
re9b4ba9 rac19a0c 4 4 5 5 const useCreateTransport = () => { 6 6 const userId = JSON.parse(localStorage.getItem('user')).userId 7 7 const createTransport = async (transport, edit) => { 8 8 if(!edit) 9 9 { 10 10 await axios 11 .post(`/transport/add `, transport)11 .post(`/transport/add/` + userId, transport) 12 12 .then((res) => { 13 13 //history.push('/transport'); -
frontend/src/Components/Hooks/User/useLogin.js
re9b4ba9 rac19a0c 4 4 import { Navigate, useAsyncValue, useNavigate } from "react-router-dom"; 5 5 import LoginForm from "../../Login/LoginForm.js"; 6 import {useAuth} from "../../Context/AuthContext"; 6 7 7 8 const useLogin = () => { 8 9 9 10 const navigator = useNavigate() 11 const Auth = useAuth(); 10 12 //const history = useNavigate(); 11 13 const login = async (loginData) => { … … 22 24 }) 23 25 .then((res) => { 26 console.log("RES LOGIN") 27 console.log(res) 28 if(res.status === 200) 29 { 30 const user = { 31 sessionId: res.data.auth.details.sessionId, 32 userId: res.data.auth.principal.userID, 33 username: res.data.auth.principal.username, 34 role: res.data.auth.principal.role, 35 name: res.data.auth.principal.name, 36 surname: res.data.auth.principal.surname, 37 } 38 Auth.userLogin(user); 39 console.log(user) 40 } 24 41 const sessionId = res.data.auth.details.sessionId; 25 42 const userId = res.data.auth.principal.userID; 26 43 27 44 localStorage.setItem("sessionId", sessionId); 28 45 localStorage.setItem("userId", userId); -
frontend/src/Components/Hooks/useGet.js
re9b4ba9 rac19a0c 12 12 console.log("url od get " + uurl) 13 13 await axios. 14 get(uurl ).then((res) => {14 get(uurl, {maxRedirects: 0}).then((res) => { 15 15 setData(res.data); 16 }).catch((err ) => {17 console.log(err )16 }).catch((error) => { 17 console.log(error) 18 18 }) 19 19 .finally(() => { … … 26 26 getData(url); 27 27 }, [dep, url, changed]); 28 28 29 29 return { 30 30 data, -
frontend/src/Components/HotelEdit/HotelEditTab.js
re9b4ba9 rac19a0c 1 1 import React from "react"; 2 import { Container, Col, Row, Image, Nav, Tab} from "react-bootstrap";3 import { useState} from "react";4 import { FaTaxi, FaHotel} from "react-icons/fa";5 import { MdOutlineStickyNote2} from "react-icons/md";2 import {Container, Col, Row, Image, Nav, Tab} from "react-bootstrap"; 3 import {useState} from "react"; 4 import {FaTaxi, FaHotel} from "react-icons/fa"; 5 import {MdOutlineStickyNote2} from "react-icons/md"; 6 6 import AddNew from "../Resources/AddNew"; 7 import { BiData} from "react-icons/bi"7 import {BiData} from "react-icons/bi" 8 8 import RoomListing from "./RoomListing"; 9 9 import HotelEditForm from "./HotelEditForm"; 10 10 import AddHotelForm from "../Forms/AddHotelForm"; 11 11 import EditModal from "../Resources/EditModal"; 12 import AddAvailability from "../Resources/AddAvailability"; 13 import useGet from "../Hooks/useGet"; 14 import ReservationListing from "./ReservationListing"; 12 15 13 16 function HotelEditTab(props) { 14 const [activeTab, setActiveTab] = useState("/hotel");15 const [modalData, setModalData] = useState("");16 const [show, setShow] = useState(false);17 const [activeTab, setActiveTab] = useState("/hotel"); 18 const [modalData, setModalData] = useState(""); 19 const [show, setShow] = useState(false); 17 20 18 const handleClose = () => setShow(false); 19 const handleShow = () => { 20 //e.preventDefault(); 21 setShow(true); 21 console.log(props) 22 22 23 }; 23 const { 24 data, 25 isLoading, 26 setData, 27 getData, 28 setChanged 29 } = useGet(`/hotel/${props.displayRoom.hotelId}/reservations/active`) 24 30 25 const showModal = (modalData) => { 26 setModalData(modalData); 27 handleShow(); 28 } 29 console.log(props.displayRoom) 31 !isLoading && console.log(data) 30 32 31 const handleSelect = (eventKey) => { 32 setActiveTab(eventKey); 33 }; 33 const handleClose = () => setShow(false); 34 const handleShow = () => { 35 //e.preventDefault(); 36 setShow(true); 34 37 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"> 38 }; 39 40 const showModal = (modalData) => { 41 setModalData(modalData); 42 handleShow(); 43 } 44 console.log(props.displayRoom) 45 46 const handleSelect = (eventKey) => { 47 setActiveTab(eventKey); 48 }; 49 50 return ( 51 <Container className="rounded-5"> 52 <Tab.Container 53 activeKey={activeTab} 54 onSelect={handleSelect} 55 className="bg-dark rounded-5" 56 > 57 <Nav 58 fill 59 variant="tabs" 60 className="bg-body rounded-top-5" 61 activeKey="/hotel" 62 id="tab_item" 63 > 64 <Nav.Item className="tab_item rounded-5"> 65 <Nav.Link eventKey="/hotel" className="text-left rounded-5"> 51 66 <span className="ikona"> 52 67 <FaHotel 53 color="#159895"54 style={{ lineHeight: "100em"}}55 size={"1.5em"}56 className="mx-3"68 color="#159895" 69 style={{lineHeight: "100em"}} 70 size={"1.5em"} 71 className="mx-3" 57 72 /> 58 73 </span> 59 <span className="ikona">Соби</span>60 </Nav.Link>61 </Nav.Item>62 <Nav.Item className="tab_item">63 <Nav.Link eventKey="/restaurant">74 <span className="ikona">Соби</span> 75 </Nav.Link> 76 </Nav.Item> 77 <Nav.Item className="tab_item"> 78 <Nav.Link eventKey="/restaurant"> 64 79 <span className="ikona"> 65 <MdOutlineStickyNote2 color="#159895" size={"1.5em"} className="mx-3" 80 <MdOutlineStickyNote2 color="#159895" size={"1.5em"} className="mx-3"/> 66 81 </span> 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">82 <span className="ikona">Резервации</span> 83 </Nav.Link> 84 </Nav.Item> 85 <Nav.Item className="tab_item rounded-5"> 86 <Nav.Link eventKey="/transport" className="text-left rounded-5"> 72 87 <span className="ikona"> 73 <BiData color="#159895" size={"1.5em"} className="mx-3" 88 <BiData color="#159895" size={"1.5em"} className="mx-3"/> 74 89 </span> 75 <span className="ikona">Општи податоци</span>76 </Nav.Link>77 </Nav.Item>78 </Nav>90 <span className="ikona">Општи податоци</span> 91 </Nav.Link> 92 </Nav.Item> 93 </Nav> 79 94 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 ); 95 <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light"> 96 <Tab.Pane eventKey="/hotel"> 97 {props.displayRoom.hotelRooms.map((room) => { 98 return <RoomListing key={room.hotelRoomId} data={room} showModal={showModal}/> 99 })} 100 <EditModal show={show} handleClose={handleClose} type="room" room={modalData}></EditModal> 101 <AddNew Id={props.displayRoom.hotelId} refresh={props.refresh} type="room"/> 102 </Tab.Pane> 103 <Tab.Pane eventKey="/restaurant"> 104 {!isLoading && data.map((res) => { 105 return ( 106 <ReservationListing data={res}/> 107 ) 108 })} 109 {/*<AddNew type="restaurant"/>*/} 110 </Tab.Pane> 111 <Tab.Pane eventKey="/transport"> 112 <AddHotelForm refresh={props.refresh} hotel={props.displayRoom}/> 113 </Tab.Pane> 114 </Tab.Content> 115 </Tab.Container> 116 </Container> 117 ); 98 118 } 99 119 -
frontend/src/Components/Layout/Navbar/Navigation.js
re9b4ba9 rac19a0c 7 7 import useGet from "../../Hooks/useGet"; 8 8 import axios from "../../../axios.js"; 9 import {useAuth} from "../../Context/AuthContext"; 9 10 //import logo from 'assets/images/logo.png'; 10 11 //src="https://upload.wikimedia.org/wikipedia/commons/0/08/Vergina_Sun_-_Golden_Larnax.png" … … 12 13 function Navigation(props) { 13 14 const navigator = useNavigate(); 14 15 const { data, setData, isLoading, getData } = useGet("/username"); 16 15 const Auth = useAuth(); 16 const isLoggedIn = Auth.userIsAuthenticated(); 17 17 return ( 18 18 <> … … 24 24 > 25 25 <Container> 26 <Navbar.Brand href=" #home">26 <Navbar.Brand href="/home"> 27 27 <span className="ikona"> 28 28 <Image … … 50 50 Pricing 51 51 </Nav.Link> 52 {!isLo ading && !data&& (52 {!isLoggedIn && ( 53 53 <Button 54 54 className="m-2" … … 62 62 </Button> 63 63 )} 64 { !isLoading && data&& (64 {isLoggedIn && ( 65 65 <> 66 66 <Nav.Link className="m-2" href="/profile"> 67 { data}67 {Auth.getUser().username} 68 68 </Nav.Link> 69 69 <Button … … 74 74 await axios.get("/logout") 75 75 .then((res) => { 76 console.log(res) 76 console.log(res); 77 Auth.userLogout(); 77 78 }) 78 79 .catch((err) => { -
frontend/src/Components/Resources/AddNew.js
re9b4ba9 rac19a0c 56 56 </Modal.Header> 57 57 <Modal.Body> 58 {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>}59 {props.type === "room" && <AddRoomForm refresh={props.refresh} hotelId={props.Id}/>}60 {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>}61 {props.type === "transport" && <AddTransportForm refresh={props.refresh}/>}58 {props.type === "hotel" && <AddHotelForm closeModal={handleClose} refresh={props.refresh}/>} 59 {props.type === "room" && <AddRoomForm closeModal={handleClose} refresh={props.refresh} hotelId={props.Id}/>} 60 {props.type === "restaurant" && <AddRestaurantForm edit="false" closeModal={handleClose} refresh={props.refresh}/>} 61 {props.type === "transport" && <AddTransportForm closeModal={handleClose} refresh={props.refresh}/>} 62 62 {props.type === "menu" && <AddItemMenuForm Id={props.Id} refresh={props.refresh}/>} 63 63 {props.type === "route" && <AddTripForm transportId={props.transport.transportID} setSize={setSizeXl} refresh={props.refresh}/>} -
frontend/src/Components/Resources/EditModal.js
re9b4ba9 rac19a0c 31 31 </Modal.Header> 32 32 <Modal.Body> 33 {props.type === "hotel" && <AddHotelForm />}33 {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>} 34 34 {props.type === "room" && <EditRoomForm refresh={props.refresh} room={props.room}/>} 35 35 {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>} -
frontend/src/Components/Resources/ResourceListing.js
re9b4ba9 rac19a0c 6 6 7 7 const ResourceListing = (props) => { 8 9 console.log("props " + props.id)10 11 8 12 9 const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот"; 13 10 const name = props.type == "hotel" ? props.data.hotelName : props.type == "restaurant" ? props.data.restaurantName : props.data.transportName 14 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.resturantId : props.data.transportID 15 return(<> 11 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.restaurantID : props.data.transportID 12 console.log(props.data) 13 return(<> 16 14 <a href={`${props.type}/${id}`} style={{textDecoration: "none", color:"black"}}> 17 15 <Container className="py-3 px-1 my-4" -
frontend/src/Components/Resources/ResourcesTab.js
re9b4ba9 rac19a0c 11 11 function ResourcesTab(props) { 12 12 const [activeTab, setActiveTab] = useState(props.tab); 13 // const [changed, setChanged] = useState(0); 14 const userId = localStorage.getItem("userId"); 13 const userId = JSON.parse(localStorage.getItem("user")).userId; 15 14 const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`); 16 15 17 16 const handleSelect = (eventKey) => { 18 17 setActiveTab(eventKey); 19 console.log(props.refresh);20 18 props.refresh(eventKey); 21 console.log("refresh" + eventKey);22 19 }; 23 24 !isLoading && console.log(data);25 console.log(props.tab);26 20 27 21 return ( … … 78 72 data.map((hotel) => { 79 73 return ( 80 <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>74 <Link style={{textDecoration: "none"}} key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}> 81 75 <ResourceListing 82 76 key={hotel.hotelId} … … 93 87 {props.tab == "/restaurant" && !isLoading && data != null && 94 88 data.map((restaurant) => { 95 console.log("mapiranje " + restaurant)96 89 return ( 97 <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>98 90 <ResourceListing 99 key={restaurant.restaurantI d}91 key={restaurant.restaurantID} 100 92 type="restaurant" 101 93 data={restaurant} 102 /> 103 </Link> 104 ); 94 />); 105 95 })} 106 96 <AddNew type="restaurant" refresh={setChanged}/> -
frontend/src/Components/RestaurantEdit/RestaurantEditTab.js
re9b4ba9 rac19a0c 100 100 return <MenuListing key={menu.menuId} data={menu} showModal={showModal}/> 101 101 })} 102 {activeTab === '/hotel' && <EditModal show={show} handleClose={handleClose} type="menu" menu={modalData}></EditModal>}102 {activeTab === '/hotel' && <EditModal show={show} refresh={props.refresh} handleClose={handleClose} type="menu" menu={modalData}></EditModal>} 103 103 <AddNew Id={props.displayMenu.restaurantID} refresh={props.refresh} type="menu"/> 104 104 </Tab.Pane> -
frontend/src/Components/SearchCriterias/SearchCriteriasBar.js
re9b4ba9 rac19a0c 2 2 import { Container, Form, Button, Row, Col } from "react-bootstrap"; 3 3 import useFormData from "../Hooks/useFormData"; 4 import SearchCriteriasHotel from "./SearchCriteriasHotel"; 5 import SearchCriteriasTransport from "./SearchCriteriasTransport"; 4 6 5 const SearchCriterias = (props) => {7 const SearchCriteriasBar = (props) => { 6 8 7 const { formData, onFormChange, onCheckBoxChange, setFormData} = useFormData(props.criterias) 8 console.log("KRITERIUMI") 9 console.log(formData) 9 const { criterias, type } = props 10 10 11 return ( 12 <> 13 <Container 14 className="p-1 pb-0 mb-5 mt-3 rounded-2" 15 style={{ backgroundColor: "#002B5B", width: "65%"}} 16 > 17 <Form className="rounded-5"> 18 <Row className="gx-1"> 19 <Col> 20 <Form.Floating className="mb-3"> 21 <Form.Control 22 size="md" 23 type="text" 24 placeholder="Каде ќе патувате?:" 25 id="location" 26 name="hotelLocation" 27 onChange={onFormChange} 28 value={formData.hotelLocation} 29 ></Form.Control> 30 <label htmlFor="location">Локација:</label> 31 </Form.Floating> 32 </Col> 33 <Col> 34 <Form.Floating className="mb-3"> 35 <Form.Control 36 size="md" 37 type="date" 38 placeholder="Датум на пристигнување:" 39 id="dateFrom" 40 name="dateFrom" 41 onChange={onFormChange} 42 value={formData.dateFrom} 43 ></Form.Control> 44 <label htmlFor="dateFrom">Датум на пристигнување:</label> 45 </Form.Floating> 46 </Col> 47 <Col> 48 <Form.Floating className="mb-3"> 49 <Form.Control 50 size="md" 51 type="date" 52 placeholder="Датум на заминување:" 53 id="dateTo" 54 name="dateTo" 55 onChange={onFormChange} 56 value={formData.dateTo} 57 ></Form.Control> 58 <label htmlFor="dateTo">Датум на заминување:</label> 59 </Form.Floating> 60 </Col> 61 <Col> 62 <Form.Floating className="mb-3"> 63 <Form.Control 64 size="md" 65 type="number" 66 placeholder="Број на гости:" 67 id="floatingPassengers" 68 name="numBeds" 69 onChange={onFormChange} 70 value={formData.numBeds} 71 ></Form.Control> 72 <label htmlFor="floatingPassengers">Број на гости:</label> 73 </Form.Floating> 74 </Col> 75 <Col> 76 <Form.Group className="my-1"> 77 <Button 78 type="submit" 79 style={{ backgroundColor: "#159895" }} 80 size="lg" 81 className="w-100" 82 onClick={(e) => { 83 e.preventDefault(); 84 window.location.href = `/search/hotel/${formData.hotelLocation}/${formData.dateFrom}/${formData.dateTo}/${formData.numBeds}` 85 }} 86 > 87 <span className="ikona mx-3">Пребарај</span> 88 </Button> 89 </Form.Group> 90 </Col> 91 </Row> 92 </Form> 93 </Container> 94 </> 95 ); 96 }; 11 return ( 12 <> 13 {type === 'hotel' && <SearchCriteriasHotel criterias={criterias}/>} 14 {type === 'transport' && <SearchCriteriasTransport criterias={criterias}/>} 15 </> 16 ) 17 } 97 18 98 export default SearchCriterias ;19 export default SearchCriteriasBar; -
frontend/src/Components/Tab/TabFormTransport.js
re9b4ba9 rac19a0c 2 2 import { Button, Col, Container, Form, Row } from "react-bootstrap"; 3 3 import { HiMagnifyingGlass } from "react-icons/hi2" 4 import useFormData from "../Hooks/useFormData"; 4 5 5 6 function TabFormTransport() { 7 8 const { formData, onFormChange, setFormData } = useFormData({ 9 from: undefined, 10 to: undefined, 11 date: undefined, 12 numPassengers: 0 13 }) 14 6 15 return ( 7 16 <Form> … … 14 23 placeholder="Од:" 15 24 id="floatingFrom" 25 value={formData.from} 26 name={'from'} 27 onChange={onFormChange} 16 28 ></Form.Control> 17 29 <label htmlFor="floatingFrom">Од:</label> … … 25 37 placeholder="До:" 26 38 id="floatingTo" 39 name={'to'} 40 value={formData.to} 41 onChange={onFormChange} 27 42 ></Form.Control> 28 43 <label htmlFor="floatingTo">До:</label> … … 36 51 placeholder="Датум:" 37 52 id="floatingDate" 53 name={'date'} 54 value={formData.date} 55 onChange={onFormChange} 38 56 ></Form.Control> 39 57 <label htmlFor="floatingDate">Датум:</label> … … 46 64 type="number" 47 65 placeholder="Број на патници:" 66 name={'numPassengers'} 48 67 id="floatingPassengers" 68 value={formData.numPassengers} 69 onChange={onFormChange} 49 70 ></Form.Control> 50 71 <label htmlFor="floatingPassengers">Број на патници:</label> 51 72 </Form.Floating> 52 73 <Form.Group className="my-1"> 53 <Button type="submit" style={{backgroundColor: "#159895"}} size="lg"> 74 <Button type="submit" style={{backgroundColor: "#159895"}} size="lg" onClick={(e) => { 75 e.preventDefault(); 76 window.location.href = `/search/transport/${formData.from}/${formData.to}/${formData.date}/${formData.numPassengers}` 77 }}> 54 78 <span className="ikona my-1"><HiMagnifyingGlass/></span> 55 79 <span className="ikona mx-3">Пребарај</span> -
frontend/src/Components/TransportDetails/FinalPoint.js
re9b4ba9 rac19a0c 17 17 <> 18 18 <Row> 19 {props.left === "true" && <Col className="d-flex flex-column justify-content-center col- auto" style={{paddingLeft: "2.6rem"}}>19 {props.left === "true" && <Col className="d-flex flex-column justify-content-center col-md-4" style={{paddingLeft: "2.6rem"}}> 20 20 <h5 className="m-auto">{getTimeAsString(props.time)}</h5> 21 21 </Col> } -
frontend/src/Components/TransportDetails/Line.js
re9b4ba9 rac19a0c 2 2 3 3 const Line = (props) => { 4 console.log(props.left) 5 const left = props.left === "true" ? "9.08rem" : "2.6rem"; 6 console.log({borderLeft: "5px solid #159895", height: "3em", marginLeft: left, marginTop: "-1.4rem", marginBottom: "-1.4rem"}) 4 const left = props.left === "true" ? "1.8rem" : "1.85rem"; 7 5 return (<> 8 6 <div style={{borderLeft: "5px solid #159895", height: "3em", marginLeft: left, marginTop: "-1.4rem", marginBottom: "-1.4rem"}}></div> -
frontend/src/Components/TransportDetails/Waypoint.js
re9b4ba9 rac19a0c 17 17 <> 18 18 <Row className="d-flex flex-row gap-0"> 19 {props.left === "true" && <Col className="d-flex flex-column justify-content-center col- auto" style={{paddingLeft: "2.6rem"}}>19 {props.left === "true" && <Col className="d-flex flex-column justify-content-center col-md-4" style={{paddingLeft: "2.6rem"}}> 20 20 <h5 style={{color: props.routes === "true" ? "white" : "" }} className="m-auto">{getTimeAsString(props.time)}</h5> 21 21 </Col>} … … 30 30 </Col>} 31 31 </Row> 32 <Row> 33 <Line left={props.left}> </Line> 34 </Row> 32 <Row className="d-flex flex-row gap-0"> 33 {props.left === "true" && <Col className="d-flex flex-column justify-content-center col-md-4" style={{paddingLeft: "2.6rem"}}> 34 35 </Col>} 36 <Col md="auto"> 37 <Line left={props.left}> </Line> 38 </Col> 39 <Col className="d-flex flex-column justify-content-center"> 40 </Col> 41 {props.left !== "true" && <Col className="d-flex flex-column justify-content-center"> 42 43 </Col>} 44 </Row> 45 {/*<Row>*/} 46 {/*<Line left={props.left}> </Line>*/} 47 {/*</Row>*/} 35 48 </> 36 49 ); -
frontend/src/Components/TransportEdit/TransportEditTab.js
re9b4ba9 rac19a0c 12 12 function TransportEditTab(props) { 13 13 const [activeTab, setActiveTab] = useState("/hotel"); 14 const link = "/transport/" + props.displayRoute.transportID + "/available";15 14 console.log(props.displayRoute) 16 const [changed, setChanged] = useState(0)17 const { data, setData, isLoading, getData } = useGet(link, changed);18 15 19 16 -
frontend/src/Components/TransportEdit/TransportListing.js
re9b4ba9 rac19a0c 9 9 10 10 //const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот"; 11 console.log(props.data)12 console.log(props.data.from)13 11 return (<> 14 12 <a href="#" style={{textDecoration: "none", color: "black"}}> … … 34 32 <Col className="d-flex flex-column justify-content-center" style={{textAlign: "left"}}> 35 33 <h2>{props.data.from} - {props.data.to}</h2> 36 {/* <h6>{props.data.routeCities}</h6> */}37 34 <h6>{props.data.routes.map(x => x).join(", ")}</h6> 38 35 </Col> … … 40 37 <Col className="d-flex flex-column justify-content-center align-content-center"> 41 38 <h5>Цена:</h5> 42 {/* <h4>{props.data.routePrice}</h4> */} 43 <h4>99$</h4> 39 <h4>{props.data.maxPrice}$</h4> 44 40 </Col> 45 41 </Row> -
frontend/src/Components/useFormNested.js
re9b4ba9 rac19a0c 7 7 console.log(e) 8 8 9 const dependantRoutes = e.target. parentElement.getAttribute('dependantRoutes').split(',')9 const dependantRoutes = e.target.name === 'freeSpace' ? e.target.parentElement.getAttribute('dependantRoutes').split(',') : undefined; 10 10 console.log(dependantRoutes) 11 11
Note:
See TracChangeset
for help on using the changeset viewer.