source: frontend/src/Pages/RestaurantDetailsPage.js@ e6c2521

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

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 8.9 KB
Line 
1import React from "react";
2import LoginForm from "../Components/Login/LoginForm";
3import {Container, Row, Col, Form} from "react-bootstrap";
4import Navigation from "../Components/Layout/Navbar/Navigation";
5import Carousel from "react-bootstrap/Carousel";
6import {useState} from "react";
7import DescriptionContainer from "../Components/HotelDetails/DescriptionContainer";
8import ReviewsCarousel from "../Components/HotelDetails/ReviewsCarousel";
9import RoomsTable from "../Components/HotelDetails/RoomsTable";
10import ContactBar from "../Components/HotelDetails/ContactBar";
11import Menu from "../Components/RestaurantDetails/Menu";
12import MenuCarousel from "../Components/RestaurantDetails/Carousel";
13import {useLocation} from "react-router-dom";
14import TablesTable from "../Components/RestaurantDetails/TablesTable";
15
16const 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 <Carousel.Item>
136 <img
137 className="d-block w-100 h-400 rounded-5"
138 src="https://emagazin.mk/wp-content/uploads/2022/03/Karos_Photography-7795.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://emagazin.mk/wp-content/uploads/2022/03/Karos_Photography-7871.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://lh5.googleusercontent.com/p/AF1QipMQAwahuuJCJ2rDUYNrhnwiX1070adTsM6LmzV5=w480-h300-k-n"
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.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 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
179export default RestaurantDetailsPage;
Note: See TracBrowser for help on using the repository browser.