source: frontend/src/Components/Resources/ResourceListing.js@ 07f4e8b

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

prefinal fixes

  • Property mode set to 100644
File size: 3.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 const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот";
12 const name = props.type == "hotel" ? props.data.hotelName : props.type == "restaurant" ? props.data.restaurantName : props.data.transportName
13 const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.restaurantID : props.data.transportID
14 console.log(props.data)
15 return (<>
16 <a style={{textDecoration: "none", color: "black"}} href={`${props.type}/${id}`}>
17 <Container className="py-3 px-1 my-4"
18 style={{
19 border: "4px solid #159895",
20 borderRadius: "1em",
21 boxShadow: "0 3px 5px #159895",
22 maxWidth: "90%",
23 }}>
24 <Row>
25 <Col className="d-flex justify-content-center">
26 <Image
27 src="https://www.imgacademy.com/sites/default/files/legacyhotel.jpg"
28 style={{
29 height: "8em",
30 borderRadius: "1em",
31 boxShadow: "0 4px 20px lightblue",
32 maxWidth: "100%",
33 }}
34 ></Image>
35 </Col>
36 <Col>
37 <h2 style={{textAlign: "left"}}>{name}</h2>
38 {props.type === "hotel" && (<>
39 <h5 style={{textAlign: "left"}}>{props.data.hotelLocation}</h5>
40 <h5 style={{textAlign: "left"}}>{props.data.hotelEmail}</h5>
41 </>)}
42 {props.type === "restaurant" && (<>
43 <h5 style={{textAlign: "left"}}>{props.data.restaurantLocation}</h5>
44 <h5 style={{textAlign: "left"}}>{props.data.cousineType} кујна</h5>
45 </>)}
46 {props.type === "transport" && (<>
47 <h5 style={{textAlign: "left"}}>{props.data.carBrand}</h5>
48 <h5 style={{textAlign: "left"}}>{props.data.carPlate}</h5>
49 </>)}
50 </Col>
51
52 {props.type !== 'transport' && <Col className="d-flex flex-column justify-content-center align-content-center">
53 <AddImages type={props.type} Id={id}/>
54 </Col>}
55 <Col className="d-flex justify-content-center align-content-center">
56 <span
57 style={{
58 backgroundColor: "#159895",
59 padding: "0.75em",
60 fontWeight: "bold",
61 fontSize: "1.8rem",
62 borderRadius: "0.75em",
63 color: "white",
64 margin: "auto"
65 }}
66 >
67 9.1
68 </span>
69 </Col>
70 </Row>
71 </Container>
72 </a>
73 </>)
74}
75
76export default ResourceListing;
Note: See TracBrowser for help on using the repository browser.