1 | import React from "react";
|
---|
2 | import LoginForm from "../Components/Login/LoginForm";
|
---|
3 | import {Container, Row, Col, Form} 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 Menu from "../Components/RestaurantDetails/Menu";
|
---|
12 | import MenuCarousel from "../Components/RestaurantDetails/Carousel";
|
---|
13 | import {useLocation} from "react-router-dom";
|
---|
14 | import TablesTable from "../Components/RestaurantDetails/TablesTable";
|
---|
15 |
|
---|
16 | const RestaurantDetailsPage = (props) => {
|
---|
17 | document.body.style.backgroundColor = "white";
|
---|
18 |
|
---|
19 | const [index, setIndex] = useState(0);
|
---|
20 | const location = useLocation();
|
---|
21 | const {data, params: formData} = location.state;
|
---|
22 |
|
---|
23 | const handleSelect = (selectedIndex) => {
|
---|
24 | setIndex(selectedIndex);
|
---|
25 | };
|
---|
26 |
|
---|
27 | return (
|
---|
28 | <>
|
---|
29 | <Navigation/>
|
---|
30 | <Container className="my-3">
|
---|
31 | <Row className="d-flex justify-content-between">
|
---|
32 | <Col style={{textAlign: "left"}}>
|
---|
33 | <h2 style={{color: "#159895"}}>{data.restaurantName}</h2>
|
---|
34 | </Col>
|
---|
35 | <Col>
|
---|
36 | <Container>
|
---|
37 | <Row className="mb-4">
|
---|
38 | <Col style={{textAlign: "right"}}>
|
---|
39 | <span
|
---|
40 | style={{
|
---|
41 | backgroundColor: "#159895",
|
---|
42 | padding: "0.75em",
|
---|
43 | fontWeight: "bold",
|
---|
44 | fontSize: "1.25rem",
|
---|
45 | borderRadius: "0.75em",
|
---|
46 | color: "white",
|
---|
47 | }}
|
---|
48 | >
|
---|
49 | {data.averageScore.toFixed(1)}
|
---|
50 | </span>
|
---|
51 | </Col>
|
---|
52 | </Row>
|
---|
53 | </Container>
|
---|
54 | </Col>
|
---|
55 | </Row>
|
---|
56 | <Row>
|
---|
57 | <Col
|
---|
58 | className="p-3 rounded-4"
|
---|
59 | sm={3}
|
---|
60 | style={{backgroundColor: "#002B5B"}}
|
---|
61 | >
|
---|
62 | <Row>
|
---|
63 | <h3 className="mb-5 mt-3" style={{color: "white"}}>Критериуми од пребарувањето</h3>
|
---|
64 | <Form.Floating className="mb-3">
|
---|
65 | <Form.Control
|
---|
66 | size="md"
|
---|
67 | type="text"
|
---|
68 | placeholder="Каде ќе патувате?:"
|
---|
69 | id="location"
|
---|
70 | name={'restaurantLocation'}
|
---|
71 | value={formData.restaurantLocation}
|
---|
72 | ></Form.Control>
|
---|
73 | <label style={{left: "10px"}} htmlFor="location">Локација:</label>
|
---|
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="date"
|
---|
83 | name={'date'}
|
---|
84 | value={formData.date}
|
---|
85 | ></Form.Control>
|
---|
86 | <label style={{left: "10px"}} htmlFor="dateFrom">Датум на резерација:</label>
|
---|
87 | </Form.Floating>
|
---|
88 | </Row>
|
---|
89 | <Row>
|
---|
90 | <Col>
|
---|
91 | <Form.Floating className="mb-3">
|
---|
92 | <Form.Control
|
---|
93 | size="lg"
|
---|
94 | type="text"
|
---|
95 | placeholder="Место:"
|
---|
96 | id="location"
|
---|
97 | name={'hourFrom'}
|
---|
98 | value={formData.hourFrom}
|
---|
99 | ></Form.Control>
|
---|
100 | <label style={{left: "10px"}} htmlFor="location">Време од:</label>
|
---|
101 | </Form.Floating>
|
---|
102 | </Col>
|
---|
103 | <Col>
|
---|
104 | <Form.Floating className="mb-3">
|
---|
105 | <Form.Control
|
---|
106 | size="lg"
|
---|
107 | type="text"
|
---|
108 | placeholder="Место:"
|
---|
109 | id="location"
|
---|
110 | name={'hourTo'}
|
---|
111 | value={formData.hourTo}
|
---|
112 | ></Form.Control>
|
---|
113 | <label style={{left: "10px"}} htmlFor="location">Време до:</label>
|
---|
114 | </Form.Floating>
|
---|
115 | </Col>
|
---|
116 | </Row>
|
---|
117 | <Row>
|
---|
118 | <Form.Floating className="mb-3">
|
---|
119 | <Form.Control
|
---|
120 | size="md"
|
---|
121 | type="number"
|
---|
122 | placeholder="Број на гости:"
|
---|
123 | id="floatingPassengers"
|
---|
124 | name={'numPeople'}
|
---|
125 | value={formData.numPeople}
|
---|
126 | ></Form.Control>
|
---|
127 | <label style={{left: "10px"}} htmlFor="floatingPassengers">Број на гости:</label>
|
---|
128 | </Form.Floating>
|
---|
129 | </Row>
|
---|
130 | </Col>
|
---|
131 | <Col>
|
---|
132 | <Container>
|
---|
133 | <Row>
|
---|
134 | <Carousel activeIndex={index} onSelect={handleSelect}>
|
---|
135 | {data.images.map((image) => {
|
---|
136 | let link = image.url;
|
---|
137 | if (image.url.includes('Desktop')) {
|
---|
138 | link = 'http://localhost:8080/download?fileName=' + encodeURIComponent(image.url);
|
---|
139 | }
|
---|
140 | return (
|
---|
141 | <Carousel.Item>
|
---|
142 | <img
|
---|
143 | className="d-block w-100 h-400 rounded-5"
|
---|
144 | src={link}
|
---|
145 | alt="First slide"
|
---|
146 | style={{ height: "50vh" }}
|
---|
147 | />
|
---|
148 | </Carousel.Item>
|
---|
149 | )
|
---|
150 | })}
|
---|
151 | {data.images.length == 0 && <Carousel.Item>
|
---|
152 | <img
|
---|
153 | className="d-block w-100 h-400 rounded-5"
|
---|
154 | src="https://emagazin.mk/wp-content/uploads/2022/03/Karos_Photography-7795.jpg"
|
---|
155 | alt="First 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.restaurantDescription} type="restaurant"></DescriptionContainer></Col>
|
---|
169 | <Col className="col-md-4"><ReviewsCarousel reviews={data.reviews}></ReviewsCarousel></Col>
|
---|
170 | </Row>
|
---|
171 | <Row className="mb-3"><MenuCarousel images={data.menuImages} menu={data.menus}></MenuCarousel></Row>
|
---|
172 | <Row><TablesTable params={formData} data={data.tables}></TablesTable></Row>
|
---|
173 | <Row><ContactBar></ContactBar></Row>
|
---|
174 | </Container>
|
---|
175 | </>
|
---|
176 | );
|
---|
177 | };
|
---|
178 |
|
---|
179 | export default RestaurantDetailsPage;
|
---|