source: frontend/src/Components/HotelDetails/Room.js@ efaa053

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

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 5.3 KB
Line 
1import React, {useState} from "react";
2import {Container, Row, Col, Image} from "react-bootstrap";
3import {LuFan} from "react-icons/lu";
4import {TbToolsKitchen2} from "react-icons/tb"
5import {MdBalcony} from "react-icons/md"
6import Carousel from "react-bootstrap/Carousel";
7
8const Room = (props) => {
9 console.log("OD SOBATA")
10 const [index, setIndex] = useState(0);
11 const handleSelect = (selectedIndex) => {
12 setIndex(selectedIndex);
13 };
14 console.log(props)
15 return (
16 <>
17 <Container style={{width: "100%"}}>
18 <Row className="g-0">
19 <Col
20 className="d-flex justify-content-center"
21 style={{maxWidth: "40%"}}
22 >
23 <Carousel activeIndex={index} onSelect={handleSelect}>
24 {props.data.images.map(img => {
25 let link = img.url;
26 if (img.url.includes('Desktop')) {
27 link = 'http://localhost:8080/download?fileName=' + encodeURIComponent(img.url);
28 }
29 return (<Carousel.Item>
30 <Image src={link}/>
31 </Carousel.Item>)
32 })}
33 {props.data.images.length === 0 && <h4>
34 Не се достапни слики!
35 </h4>}
36 </Carousel>
37 </Col>
38 <Col>
39 <Container className="m-auto">
40 <Row>
41 <h5 style={{textAlign: "left"}}>
42 {props.data.hotelRoomName}
43 </h5>
44 </Row>
45 <Row>
46 {props.data.airCondition && <Col className="col-auto">
47 <Container className="py-1 px-1">
48 <Row className="d-flex flex-row">
49 <Col className="m-0 w-25 py-1">
50 <LuFan
51 className="my-0 "
52 color="#159895"
53 size={25}
54 ></LuFan>
55 </Col>
56 <Col className="w-75 d-flex p-0">
57 <h6 style={{fontSize: "10px"}} className="m-auto">
58 Климатизирано
59 </h6>
60 </Col>
61 </Row>
62 </Container>
63 </Col>}
64 {props.data.kitchenAvailable && <Col className="col-auto">
65 <Container
66 className="py-1 px-1">
67 <Row className="d-flex flex-row">
68 <Col className="m-0 w-25 py-1">
69 <TbToolsKitchen2 className="my-0 " color="#159895"
70 size={25}></TbToolsKitchen2>
71 </Col>
72 <Col className="w-75 d-flex p-0">
73 <h6 style={{fontSize: "10px"}} className="m-auto">Кујна</h6>
74 </Col>
75 </Row>
76 </Container>
77 </Col>}
78 {props.data.balcony && <Col className="col-auto">
79 <Container
80 className="py-1 px-1">
81 <Row className="d-flex flex-row">
82 <Col className="m-0 w-25 py-1">
83 <MdBalcony className="my-0 " color="#159895" size={25}></MdBalcony>
84 </Col>
85 <Col className="w-75 d-flex p-0">
86 <h6 style={{fontSize: "10px"}} className="m-auto">Тераса</h6>
87 </Col>
88 </Row>
89 </Container>
90 </Col>}
91 </Row>
92 <Row>
93 <p style={{textAlign: "left", textDecoration: "none"}}>
94 {props.data.hotelRoomDescription}
95 </p>
96 </Row>
97 </Container>
98 </Col>
99 </Row>
100 </Container>
101 </>
102);
103};
104
105export default Room;
Note: See TracBrowser for help on using the repository browser.