source: frontend/src/Pages/TransportEditPage.js@ ac19a0c

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

authContext impl, admin panel impl, search bar fixes, reservations listings impl

  • Property mode set to 100644
File size: 2.8 KB
Line 
1import React, {useState} from "react";
2import {Container, Col, Row, Image} from "react-bootstrap";
3import Navigation from "../Components/Layout/Navbar/Navigation";
4import ResourcesTab from "../Components/Resources/ResourcesTab";
5import HotelEditTab from "../Components/HotelEdit/HotelEditTab";
6import RestaurantEditTab from "../Components/RestaurantEdit/RestaurantEditTab";
7import TransportEditTab from "../Components/TransportEdit/TransportEditTab";
8import useGet from "../Components/Hooks/useGet";
9import {Navigate, useParams} from "react-router-dom";
10import {useAuth} from "../Components/Context/AuthContext";
11
12const 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
65export default TransportEditPage;
Note: See TracBrowser for help on using the repository browser.