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 useGet from "../Components/Hooks/useGet";
|
---|
8 | import {Navigate, useParams, useSearchParams} from "react-router-dom";
|
---|
9 | import {useAuth} from "../Components/Context/AuthContext";
|
---|
10 |
|
---|
11 | const RestaurantEditPage = () => {
|
---|
12 |
|
---|
13 | const params = useParams();
|
---|
14 | const link = "/restaurant/" + params.restaurantId;
|
---|
15 | //const [changed, setChanged] = useState(0)
|
---|
16 | const { data, setData, isLoading, getData, setChanged } = useGet(link, "");
|
---|
17 |
|
---|
18 | return (
|
---|
19 | <>
|
---|
20 | <Navigation />
|
---|
21 | {!isLoading && <Container>
|
---|
22 | <Row className="mb-5">
|
---|
23 | <h2 style={{ color: "#159895", textAlign: "left" }}>Мои ресурси</h2>
|
---|
24 | </Row>
|
---|
25 | <Row className="mb-5">
|
---|
26 | <Col>
|
---|
27 | <Row className="d-flex mb-3">
|
---|
28 | <Col
|
---|
29 | className="d-flex justify-content-center"
|
---|
30 | style={{ maxWidth: "30%" }}
|
---|
31 | >
|
---|
32 | <Image
|
---|
33 | src="https://t3.ftcdn.net/jpg/05/16/27/58/360_F_516275801_f3Fsp17x6HQK0xQgDQEELoTuERO4SsWV.jpg"
|
---|
34 | style={{
|
---|
35 | height: "5em",
|
---|
36 | borderRadius: "50%",
|
---|
37 | maxWidth: "100%",
|
---|
38 | }}
|
---|
39 | className="m-auto"
|
---|
40 | ></Image>
|
---|
41 | </Col>
|
---|
42 | <Col className="d-flex justify-content-center">
|
---|
43 | <Container className="pt-2" style={{ textAlign: "left" }}>
|
---|
44 | <h4>{data.restaurantName}</h4>
|
---|
45 | <h5>{data.restaurantLocation}</h5>
|
---|
46 | </Container>
|
---|
47 | </Col>
|
---|
48 | </Row>
|
---|
49 | </Col>
|
---|
50 | </Row>
|
---|
51 | <Row>
|
---|
52 | <RestaurantEditTab refresh={setChanged} displayMenu={data} edit="true"/>
|
---|
53 | </Row>
|
---|
54 | </Container>}
|
---|
55 | </>
|
---|
56 | );
|
---|
57 | };
|
---|
58 |
|
---|
59 | export default RestaurantEditPage;
|
---|