1 | import React from "react";
|
---|
2 | import { Container, Row, Col, Button } from "react-bootstrap";
|
---|
3 | import { RxDot } from "react-icons/rx";
|
---|
4 | import Line from "../TransportDetails/Line";
|
---|
5 | import Waypoint from "../TransportDetails/Waypoint";
|
---|
6 | import FinalPoint from "../TransportDetails/FinalPoint";
|
---|
7 | import { MdOutlineLocalOffer } from "react-icons/md";
|
---|
8 | import { Link } from "react-router-dom"
|
---|
9 |
|
---|
10 | const TransportListing = (props) => {
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 | return (
|
---|
15 | <>
|
---|
16 | <Container
|
---|
17 | className="py-4 px-3 my-4"
|
---|
18 | style={{
|
---|
19 | border: "4px solid lightblue",
|
---|
20 | borderRadius: "1em",
|
---|
21 | boxShadow: "0 3px 5px lightblue",
|
---|
22 | maxWidth: "60%",
|
---|
23 | }}
|
---|
24 | >
|
---|
25 | <Row>
|
---|
26 | <Col>
|
---|
27 | <Waypoint left="true" city={props.data.from} time={props.data.date}></Waypoint>
|
---|
28 | <Waypoint left="true" city={props.data.routes.join(", ")} time={props.data.date} routes="true"></Waypoint>
|
---|
29 | <FinalPoint left="true" city={props.data.to} time={props.data.time}></FinalPoint>
|
---|
30 | </Col>
|
---|
31 | <Col>
|
---|
32 | <Container
|
---|
33 | fluid
|
---|
34 | className="px-0"
|
---|
35 | style={{
|
---|
36 | display: "flex",
|
---|
37 | flexDirection: "column",
|
---|
38 | alignItems: "flex-end",
|
---|
39 | justifyContent: "space-between",
|
---|
40 | height: "100%",
|
---|
41 | }}
|
---|
42 | >
|
---|
43 | <Row className="justify-self-end mr-5 mb-3" style={{ textAlign: "right" }}>
|
---|
44 | <Col style={{ textAlign: "right" }}>
|
---|
45 | <h6 className="my-auto">Многу добро</h6>
|
---|
46 | </Col>
|
---|
47 | <Col>
|
---|
48 | <span className="my-auto"
|
---|
49 | style={{
|
---|
50 | backgroundColor: "#159895",
|
---|
51 | padding: "0.75em",
|
---|
52 | fontWeight: "bold",
|
---|
53 | fontSize: "1.25rem",
|
---|
54 | borderRadius: "0.75em",
|
---|
55 | color: "white",
|
---|
56 | }}
|
---|
57 | >
|
---|
58 | {(props.data.reviews.reduce((sum, r) => sum + r.numStar, 0) / props.data.reviews.length).toFixed(1)}
|
---|
59 | </span>
|
---|
60 | </Col>
|
---|
61 | </Row>
|
---|
62 | <Row className="w-50 justify-self-end">
|
---|
63 | <Container
|
---|
64 | className="justify-self-end"
|
---|
65 | style={{ textAlign: "right" }}
|
---|
66 | >
|
---|
67 | <Row>
|
---|
68 | <h4>{props.data.price}$</h4>
|
---|
69 | </Row>
|
---|
70 | <Row className="w-100">
|
---|
71 | <Link to="/details/transport" state={ {data: props.data, params: props.params} }>
|
---|
72 | <Button
|
---|
73 | className="m-2"
|
---|
74 | size="md"
|
---|
75 | style={{ backgroundColor: "#159895" }}
|
---|
76 | >
|
---|
77 | <MdOutlineLocalOffer size={"1.5em"}></MdOutlineLocalOffer>{" "}
|
---|
78 | Кон понудата
|
---|
79 | </Button>
|
---|
80 | </Link>
|
---|
81 | </Row>
|
---|
82 | </Container>
|
---|
83 | </Row>
|
---|
84 | </Container>
|
---|
85 | </Col>
|
---|
86 | </Row>
|
---|
87 | </Container>
|
---|
88 | </>
|
---|
89 | );
|
---|
90 | };
|
---|
91 |
|
---|
92 | export default TransportListing;
|
---|