source: frontend/src/Pages/HotelDetailsPage.js@ 5528b99

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

revert

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