source: frontend/src/Components/TransportDetails/Waypoint.js@ e9b4ba9

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

prototype

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[e9b4ba9]1import React from "react";
2import { Container, Row, Col } from "react-bootstrap";
3import { RxDot } from "react-icons/rx"
4import Line from "./Line";
5
6const Waypoint = (props) => {
7 console.log(props.left)
8 const style = props.left === "true" ? {textAlign: "left"} : {}
9 console.log(style)
10
11 const getTimeAsString = (dateString) => {
12 const date = new Date(dateString)
13 return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
14 }
15
16 return (
17 <>
18 <Row className="d-flex flex-row gap-0">
19 {props.left === "true" && <Col className="d-flex flex-column justify-content-center col-auto" style={{paddingLeft: "2.6rem"}}>
20 <h5 style={{color: props.routes === "true" ? "white" : "" }} className="m-auto">{getTimeAsString(props.time)}</h5>
21 </Col>}
22 <Col md="auto">
23 <RxDot size={"4rem"} color="#159895"></RxDot>
24 </Col>
25 <Col className="d-flex flex-column justify-content-center">
26 <h3 className="my-auto" style={{...style, fontSize: props.routes === "true" ? "1.3rem" : "", color: props.routes === "true" ? "#708090 " : ""}}>{props.city}</h3>
27 </Col>
28 {props.left !== "true" && <Col className="d-flex flex-column justify-content-center">
29 <h5>{getTimeAsString(props.time)}</h5>
30 </Col>}
31 </Row>
32 <Row>
33 <Line left={props.left}> </Line>
34 </Row>
35 </>
36 );
37};
38
39export default Waypoint;
Note: See TracBrowser for help on using the repository browser.