[e6c2521] | 1 | import React, {useState} from "react";
|
---|
| 2 | import {Container, Col, Row, Image} from "react-bootstrap";
|
---|
| 3 | import Navigation from "../Components/Layout/Navbar/Navigation";
|
---|
| 4 | import ResourcesTab from "../Components/Resources/ResourcesTab";
|
---|
| 5 | import HotelEditTab from "../Components/HotelEdit/HotelEditTab";
|
---|
| 6 | import RestaurantEditTab from "../Components/RestaurantEdit/RestaurantEditTab";
|
---|
| 7 | import TransportEditTab from "../Components/TransportEdit/TransportEditTab";
|
---|
| 8 | import useGet from "../Components/Hooks/useGet";
|
---|
| 9 | import {Navigate, useParams} from "react-router-dom";
|
---|
| 10 | import {useAuth} from "../Components/Context/AuthContext";
|
---|
| 11 |
|
---|
| 12 | const TransportEditPage = () => {
|
---|
| 13 |
|
---|
| 14 | const params = useParams();
|
---|
| 15 |
|
---|
| 16 | const link = "/transport/" + params.transportId;
|
---|
| 17 |
|
---|
| 18 | const {data, setData, isLoading, getData, setChanged} = useGet(link);
|
---|
| 19 |
|
---|
| 20 | !isLoading && console.log(data)
|
---|
| 21 |
|
---|
| 22 | return (
|
---|
| 23 | <>
|
---|
| 24 | <Navigation/>
|
---|
| 25 | {!isLoading && (
|
---|
| 26 | <Container>
|
---|
| 27 | <Row className="mb-5">
|
---|
| 28 | <h2 style={{color: "#159895", textAlign: "left"}}>Мои ресурси</h2>
|
---|
| 29 | </Row>
|
---|
| 30 | <Row className="mb-5">
|
---|
| 31 | <Col>
|
---|
| 32 | <Row className="d-flex mb-3">
|
---|
| 33 | <Col
|
---|
| 34 | className="d-flex justify-content-center"
|
---|
| 35 | style={{maxWidth: "30%"}}
|
---|
| 36 | >
|
---|
| 37 | <Image
|
---|
| 38 | src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
|
---|
| 39 | style={{
|
---|
| 40 | height: "5em",
|
---|
| 41 | borderRadius: "50%",
|
---|
| 42 | maxWidth: "100%",
|
---|
| 43 | }}
|
---|
| 44 | className="m-auto"
|
---|
| 45 | ></Image>
|
---|
| 46 | </Col>
|
---|
| 47 | <Col className="d-flex justify-content-center">
|
---|
| 48 | <Container className="pt-2" style={{textAlign: "left"}}>
|
---|
| 49 | <h4>{data.transportName}</h4>
|
---|
| 50 | <h5>{data.carBrand + " " + data.carType}</h5>
|
---|
| 51 | </Container>
|
---|
| 52 | </Col>
|
---|
| 53 | </Row>
|
---|
| 54 | </Col>
|
---|
| 55 | </Row>
|
---|
| 56 | <Row>
|
---|
| 57 | {data && <TransportEditTab displayRoute={data} refresh={setChanged}/>}
|
---|
| 58 | </Row>
|
---|
| 59 | </Container>
|
---|
| 60 | )}
|
---|
| 61 | </>
|
---|
| 62 | );
|
---|
| 63 | };
|
---|
| 64 |
|
---|
| 65 | export default TransportEditPage;
|
---|