source: frontend/src/Components/Resources/ResourceListing.js@ 5528b99

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

revert

  • Property mode set to 100644
File size: 5.6 KB
Line 
1import React from "react";
2import {useState} from "react";
3import {Col, Container, Row, Image, Modal, Button} from "react-bootstrap";
4import LoginForm from "../Login/LoginForm";
5import ChangePasswordForm from "../Forms/ChangePasswordForm";
6import AddAvailability from "./AddAvailability";
7import AddImages from "./AddImages";
8
9const ResourceListing = (props) => {
10
11 console.log("props " + props.id)
12
13
14 const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот";
15 const name = props.type == "hotel" ? props.data.hotelName : props.type == "restaurant" ? props.data.restaurantName : props.data.transportName
16<<<<<<< HEAD
17 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.restaurantID : props.data.transportID
18 console.log(props.data)
19 return (<>
20 <a style={{textDecoration: "none", color: "black"}} href={`${props.type}/${id}`}>
21 <Container className="py-3 px-1 my-4"
22 style={{
23 border: "4px solid #159895",
24 borderRadius: "1em",
25 boxShadow: "0 3px 5px #159895",
26 maxWidth: "90%",
27 }}>
28 <Row>
29 <Col className="d-flex justify-content-center">
30 <Image
31 src="https://www.imgacademy.com/sites/default/files/legacyhotel.jpg"
32 style={{
33 height: "8em",
34 borderRadius: "1em",
35 boxShadow: "0 4px 20px lightblue",
36 maxWidth: "100%",
37 }}
38 ></Image>
39 </Col>
40 <Col>
41 <h2 style={{textAlign: "left"}}>{name}</h2>
42 {props.type === "hotel" && (<>
43 <h5 style={{textAlign: "left"}}>{props.data.hotelLocation}</h5>
44 <h5 style={{textAlign: "left"}}>{props.data.hotelEmail}</h5>
45 </>)}
46 {props.type === "restaurant" && (<>
47 <h5 style={{textAlign: "left"}}>{props.data.restaurantLocation}</h5>
48 <h5 style={{textAlign: "left"}}>{props.data.cousineType} кујна</h5>
49 </>)}
50 {props.type === "transport" && (<>
51 <h5 style={{textAlign: "left"}}>{props.data.carBrand}</h5>
52 <h5 style={{textAlign: "left"}}>{props.data.carPlate}</h5>
53 </>)}
54 </Col>
55
56 <Col className="d-flex flex-column justify-content-center align-content-center">
57 <AddImages type={props.type} Id={id} />
58 </Col>
59 <Col className="d-flex justify-content-center align-content-center">
60=======
61 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.resturantId : props.data.transportID
62 return(<>
63 <a href={`${props.type}/${id}`} style={{textDecoration: "none", color:"black"}}>
64 <Container className="py-3 px-1 my-4"
65 style={{
66 border: "4px solid #159895",
67 borderRadius: "1em",
68 boxShadow: "0 3px 5px #159895",
69 maxWidth: "90%",
70 }}>
71 <Row>
72 <Col className="d-flex justify-content-center">
73 <Image
74 src="https://www.imgacademy.com/sites/default/files/legacyhotel.jpg"
75 style={{
76 height: "8em",
77 borderRadius: "1em",
78 boxShadow: "0 4px 20px lightblue",
79 maxWidth: "100%",
80 }}
81 ></Image>
82 </Col>
83 <Col >
84 <h2 style={{textAlign: "left"}}>{name}</h2>
85 {props.type === "hotel" && (<>
86 <h5 style={{textAlign: "left"}}>{props.data.hotelLocation}</h5>
87 <h5 style={{textAlign: "left"}}>{props.data.hotelEmail}</h5>
88 </>)}
89 {props.type === "restaurant" && (<>
90 <h5 style={{textAlign: "left"}}>{props.data.restaurantLocation}</h5>
91 <h5 style={{textAlign: "left"}}>{props.data.cousineType} кујна</h5>
92 </>)}
93 {props.type === "transport" && (<>
94 <h5 style={{textAlign: "left"}}>{props.data.carBrand}</h5>
95 <h5 style={{textAlign: "left"}}>{props.data.carPlate}</h5>
96 </>)}
97 </Col>
98 <Col className="d-flex justify-content-center align-content-center" >
99>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
100 <span
101 style={{
102 backgroundColor: "#159895",
103 padding: "0.75em",
104 fontWeight: "bold",
105 fontSize: "1.8rem",
106 borderRadius: "0.75em",
107 color: "white",
108 margin: "auto"
109 }}
110 >
111 9.1
112 </span>
113 </Col>
114 </Row>
115 </Container>
116 </a>
117 </>)
118}
119
120export default ResourceListing;
Note: See TracBrowser for help on using the repository browser.