Ignore:
Timestamp:
01/13/24 23:19:50 (6 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
e85a562
Parents:
e9b4ba9
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Pages/HotelEditPage.js

    re9b4ba9 rac19a0c  
    1 import React, { useState } from "react";
    2 import { Container, Col, Row, Image } from "react-bootstrap";
     1import React, {useState} from "react";
     2import {Container, Col, Row, Image} from "react-bootstrap";
    33import Navigation from "../Components/Layout/Navbar/Navigation";
    44import ResourcesTab from "../Components/Resources/ResourcesTab";
    55import HotelEditTab from "../Components/HotelEdit/HotelEditTab";
    66import useGet from "../Components/Hooks/useGet";
    7 import { useParams } from "react-router-dom";
     7import {Navigate, useParams} from "react-router-dom";
     8import {useAuth} from "../Components/Context/AuthContext";
    89
    910
    1011const HotelEditPage = () => {
    1112
    12   const params = useParams();
    13   const link = "/hotel/list/" + params.hotelId;
    14   const [changed, setChanged] = useState(0)
    15   const { data, setData, isLoading, getData } = useGet(link, changed);
     13    const params = useParams();
     14    const link = "/hotel/list/" + params.hotelId;
     15    const [changed, setChanged] = useState(0)
     16    const {data, setData, isLoading, getData} = useGet(link, changed);
    1617
    1718
    18   console.log(data)
    19   return (
    20     <>
    21       <Navigation />
    22       {!isLoading && <Container>
    23         <Row className="mb-5">
    24           <h2 style={{ color: "#159895", textAlign: "left" }}>Мои ресурси</h2>
    25         </Row>
    26         <Row className="mb-5">
    27           <Col>
    28             <Row className="d-flex mb-3">
    29               <Col
    30                 className="d-flex justify-content-center"
    31                 style={{ maxWidth: "30%" }}
    32               >
    33                 <Image
    34                   src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
    35                   style={{
    36                     height: "5em",
    37                     borderRadius: "50%",
    38                     maxWidth: "100%",
    39                   }}
    40                   className="m-auto"
    41                 ></Image>
    42               </Col>
    43               <Col className="d-flex justify-content-center">
    44                 <Container className="pt-2" style={{ textAlign: "left" }}>
    45                   <h4>{data.hotelName}</h4>
    46                   <h5>{data.hotelLocation}</h5>
    47                 </Container>
    48               </Col>
    49             </Row>
    50           </Col>
    51         </Row>
    52         <Row>
    53             <HotelEditTab refresh={setChanged} displayRoom={data}/>
    54         </Row>
    55       </Container>}
    56     </>
    57   );
     19    console.log(data)
     20    return (
     21        <>
     22            <Navigation/>
     23            {!isLoading && <Container>
     24                <Row className="mb-5">
     25                    <h2 style={{color: "#159895", textAlign: "left"}}>Мои ресурси</h2>
     26                </Row>
     27                <Row className="mb-5">
     28                    <Col>
     29                        <Row className="d-flex mb-3">
     30                            <Col
     31                                className="d-flex justify-content-center"
     32                                style={{maxWidth: "30%"}}
     33                            >
     34                                <Image
     35                                    src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
     36                                    style={{
     37                                        height: "5em",
     38                                        borderRadius: "50%",
     39                                        maxWidth: "100%",
     40                                    }}
     41                                    className="m-auto"
     42                                ></Image>
     43                            </Col>
     44                            <Col className="d-flex justify-content-center">
     45                                <Container className="pt-2" style={{textAlign: "left"}}>
     46                                    <h4>{data.hotelName}</h4>
     47                                    <h5>{data.hotelLocation}</h5>
     48                                </Container>
     49                            </Col>
     50                        </Row>
     51                    </Col>
     52                </Row>
     53                <Row>
     54                    <HotelEditTab refresh={setChanged} displayRoom={data}/>
     55                </Row>
     56            </Container>}
     57        </>
     58    );
    5859};
    5960
Note: See TracChangeset for help on using the changeset viewer.