[e6c2521] | 1 | import React from "react";
|
---|
| 2 | import LoginForm from "../Components/Login/LoginForm";
|
---|
| 3 | import {Container, Row, Col, Form, FloatingLabel, Modal, Button} from "react-bootstrap";
|
---|
| 4 | import Navigation from "../Components/Layout/Navbar/Navigation";
|
---|
| 5 | import Carousel from "react-bootstrap/Carousel";
|
---|
| 6 | import { useState } from "react";
|
---|
| 7 | import DescriptionContainer from "../Components/HotelDetails/DescriptionContainer";
|
---|
| 8 | import ReviewsCarousel from "../Components/HotelDetails/ReviewsCarousel";
|
---|
| 9 | import RoomsTable from "../Components/HotelDetails/RoomsTable";
|
---|
| 10 | import ContactBar from "../Components/HotelDetails/ContactBar";
|
---|
| 11 | import { useLocation } from "react-router-dom";
|
---|
| 12 |
|
---|
| 13 | const HotelDetailsPage = (props) => {
|
---|
| 14 | document.body.style.backgroundColor = "white";
|
---|
| 15 |
|
---|
| 16 | const [index, setIndex] = useState(0);
|
---|
| 17 |
|
---|
| 18 | const location = useLocation();
|
---|
| 19 | const { data, from, to } = location.state;
|
---|
| 20 | console.log(location)
|
---|
| 21 | console.log("DETAILS ")
|
---|
| 22 | console.log(data)
|
---|
| 23 |
|
---|
| 24 | const handleSelect = (selectedIndex) => {
|
---|
| 25 | setIndex(selectedIndex);
|
---|
| 26 | };
|
---|
| 27 |
|
---|
| 28 | return (
|
---|
| 29 | <>
|
---|
| 30 | <Navigation />
|
---|
| 31 | <Container className="my-3">
|
---|
| 32 | <Row className="d-flex justify-content-between">
|
---|
| 33 | <Col style={{textAlign: "left"}}>
|
---|
| 34 | <h2 style={{color: "#159895"}}>{data.hotelName}</h2>
|
---|
| 35 | </Col>
|
---|
| 36 | <Col>
|
---|
| 37 | <Container>
|
---|
| 38 | <Row className="mb-4">
|
---|
| 39 | <Col style={{textAlign: "right"}}>
|
---|
| 40 | <span
|
---|
| 41 | style={{
|
---|
| 42 | backgroundColor: "#159895",
|
---|
| 43 | padding: "0.75em",
|
---|
| 44 | fontWeight: "bold",
|
---|
| 45 | fontSize: "1.25rem",
|
---|
| 46 | borderRadius: "0.75em",
|
---|
| 47 | color: "white",
|
---|
| 48 | }}
|
---|
| 49 | >
|
---|
| 50 | {data.averageScore.toFixed(1)}
|
---|
| 51 | </span>
|
---|
| 52 | </Col>
|
---|
| 53 | </Row>
|
---|
| 54 | </Container>
|
---|
| 55 | </Col>
|
---|
| 56 | </Row>
|
---|
| 57 | <Row>
|
---|
| 58 | <Col
|
---|
| 59 | className="p-3 rounded-4"
|
---|
| 60 | sm={3}
|
---|
| 61 | style={{ backgroundColor: "#002B5B" }}
|
---|
| 62 | >
|
---|
| 63 | <Row>
|
---|
| 64 | <h3 className="mb-5 mt-3" style={{color: "white"}}>Критериуми од пребарувањето</h3>
|
---|
| 65 | <Form.Floating className="mb-3">
|
---|
| 66 | <Form.Control
|
---|
| 67 | size="md"
|
---|
| 68 | type="text"
|
---|
| 69 | placeholder="Каде ќе патувате?:"
|
---|
| 70 | id="location"
|
---|
[07f4e8b] | 71 | value={data.hotelLocation}
|
---|
[e6c2521] | 72 | ></Form.Control>
|
---|
[07f4e8b] | 73 | <label style={{left: "10px"}} htmlFor="location">Локација:</label>
|
---|
[e6c2521] | 74 | </Form.Floating>
|
---|
| 75 | </Row>
|
---|
| 76 | <Row>
|
---|
| 77 | <Form.Floating className="mb-3">
|
---|
| 78 | <Form.Control
|
---|
| 79 | size="md"
|
---|
| 80 | type="date"
|
---|
| 81 | placeholder="Датум на пристигнување:"
|
---|
| 82 | id="dateFrom"
|
---|
[07f4e8b] | 83 | value={from}
|
---|
[e6c2521] | 84 | ></Form.Control>
|
---|
[07f4e8b] | 85 | <label style={{left: "10px"}} htmlFor="dateFrom">Датум на пристигнување:</label>
|
---|
[e6c2521] | 86 | </Form.Floating>
|
---|
| 87 | </Row>
|
---|
| 88 | <Row>
|
---|
| 89 | <Form.Floating className="mb-3">
|
---|
| 90 | <Form.Control
|
---|
| 91 | size="md"
|
---|
| 92 | type="date"
|
---|
| 93 | placeholder="Датум на заминување:"
|
---|
| 94 | id="dateTo"
|
---|
[07f4e8b] | 95 | value={to}
|
---|
[e6c2521] | 96 | ></Form.Control>
|
---|
[07f4e8b] | 97 | <label style={{left: "10px"}} htmlFor="dateTo">Датум на заминување:</label>
|
---|
[e6c2521] | 98 | </Form.Floating>
|
---|
| 99 | </Row>
|
---|
| 100 | <Row>
|
---|
| 101 | <Form.Floating className="mb-3">
|
---|
| 102 | <Form.Control
|
---|
| 103 | size="md"
|
---|
| 104 | type="number"
|
---|
| 105 | placeholder="Број на гости:"
|
---|
| 106 | id="floatingPassengers"
|
---|
| 107 | ></Form.Control>
|
---|
[07f4e8b] | 108 | <label style={{left: "10px"}} htmlFor="floatingPassengers">Број на гости:</label>
|
---|
[e6c2521] | 109 | </Form.Floating>
|
---|
| 110 | </Row>
|
---|
| 111 | </Col>
|
---|
| 112 | <Col>
|
---|
| 113 | <Container>
|
---|
| 114 | <Row>
|
---|
| 115 | <Carousel activeIndex={index} onSelect={handleSelect}>
|
---|
| 116 | {data.images.map((image) => {
|
---|
| 117 | let link = image.url;
|
---|
| 118 | if (image.url.includes('Desktop')) {
|
---|
| 119 | link = 'http://localhost:8080/download?fileName=' + encodeURIComponent(image.url);
|
---|
| 120 | }
|
---|
| 121 | return (
|
---|
| 122 | <Carousel.Item>
|
---|
| 123 | <img
|
---|
| 124 | className="d-block w-100 h-400 rounded-5"
|
---|
| 125 | src={link}
|
---|
| 126 | alt="First slide"
|
---|
| 127 | style={{ height: "50vh" }}
|
---|
| 128 | />
|
---|
| 129 | </Carousel.Item>
|
---|
| 130 | )
|
---|
| 131 | })}
|
---|
| 132 | <Carousel.Item>
|
---|
| 133 | <img
|
---|
| 134 | className="d-block w-100 h-400 rounded-5"
|
---|
| 135 | src="https://www.kovz.gov.mk/articleImage.img/2022/08/05/JPG_010_-_Jovan_Kaneo_church_in_Ohrid__panorama-min.jpg"
|
---|
| 136 | alt="First slide"
|
---|
| 137 | style={{ height: "50vh" }}
|
---|
| 138 | />
|
---|
| 139 | </Carousel.Item>
|
---|
| 140 | <Carousel.Item>
|
---|
| 141 | <img
|
---|
| 142 | className="d-block w-100 rounded-5"
|
---|
| 143 | src="https://macedonia-timeless.com/wp-content/uploads/2018/08/dojran-ezero.jpg"
|
---|
| 144 | alt="Second slide"
|
---|
| 145 | style={{ height: "50vh" }}
|
---|
| 146 | />
|
---|
| 147 | </Carousel.Item>
|
---|
| 148 | <Carousel.Item>
|
---|
| 149 | <img
|
---|
| 150 | className="d-block w-100 rounded-5"
|
---|
| 151 | src="https://i.imgur.com/NFlxbqY.jpg"
|
---|
| 152 | alt="Third slide"
|
---|
| 153 | style={{ height: "50vh" }}
|
---|
| 154 | />
|
---|
| 155 | </Carousel.Item>
|
---|
| 156 | </Carousel>
|
---|
| 157 | </Row>
|
---|
| 158 | <Row>
|
---|
| 159 | <Container></Container>
|
---|
| 160 | </Row>
|
---|
| 161 | </Container>
|
---|
| 162 | </Col>
|
---|
| 163 | </Row>
|
---|
| 164 | <Row className="mb-5">
|
---|
| 165 | <Col className="col-md-8"><DescriptionContainer data={data.hotelDescripiton} type="hotel"></DescriptionContainer></Col>
|
---|
| 166 | <Col className="col-md-4"><ReviewsCarousel reviews={data.hotelReviews}></ReviewsCarousel></Col>
|
---|
| 167 | </Row>
|
---|
| 168 | <Row className="mb-3"><RoomsTable from={from} to={to} data={data.hotelRooms}></RoomsTable></Row>
|
---|
| 169 | <Row><ContactBar></ContactBar></Row>
|
---|
| 170 | </Container>
|
---|
| 171 | </>
|
---|
| 172 | );
|
---|
| 173 | };
|
---|
| 174 |
|
---|
| 175 | export default HotelDetailsPage;
|
---|