Ignore:
Timestamp:
01/24/24 17:42:28 (5 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
0f5aa27
Parents:
5528b99
Message:

prefinal fixes

Location:
frontend/src/Components/RestaurantDetails
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/RestaurantDetails/Carousel.js

    r5528b99 r07f4e8b  
    1212            <Row className='d-flex justify-content-center align-items-center'><h2>Мени</h2></Row>
    1313            <hr className='m-2'></hr>
    14             <Menu menu={props.menu}></Menu>
     14            <Menu images={props.images} menu={props.menu}></Menu>
    1515        </>
    1616    );
  • frontend/src/Components/RestaurantDetails/Menu.js

    r5528b99 r07f4e8b  
    2323
    2424
     25
     26
    2527    return (<>
    2628        <Carousel activeIndex={ind} onSelect={handleSelect} indicators={false}>
     
    3436                                        return (
    3537                                            <Col>
    36                                                 <MenuItem data={menuItem}/>
     38                                                <MenuItem images={    props.images.filter(x => {
     39                                                    console.log(x)
     40                                                    return x.menu.menuId === menuItem.menuId
     41                                                })} data={menuItem}/>
    3742                                            </Col>
    3843                                        )
  • frontend/src/Components/RestaurantDetails/MenuItem.js

    r5528b99 r07f4e8b  
    11import React from "react";
    22import {Col, Row, Image, Container} from "react-bootstrap";
     3import Carousel from "react-bootstrap/Carousel";
    34
    45const MenuItem = (props) => {
    56
    67    const data = props.data;
     8    console.log("dva orla")
     9    console.log(props)
    710    return (<>
    811
     
    1720                <Row>
    1821                    <Col className="d-flex justify-content-center mb-3">
    19                         <Image
    20                             src="https://www.tasteofhome.com/wp-content/uploads/2019/01/medium-rare-steak-shutterstock_706040446.jpg"
    21                             style={{
    22                                 height: "7em",
    23                                 borderRadius: "1em",
    24                                 boxShadow: "0 4px 20px lightblue",
    25                                 maxWidth: "100%",
    26                             }}
    27                         ></Image>
     22                        <Carousel>
     23                            {props.images.map((image) => {
     24                                let link = image.url;
     25                                if (image.url.includes('Desktop')) {
     26                                    link = 'http://localhost:8080/download?fileName=' + encodeURIComponent(image.url);
     27                                }
     28                                return (
     29                                    <Carousel.Item>
     30                                        <img
     31                                            className="d-block w-100 h-400 rounded-5"
     32                                            src={link}
     33                                            alt="First slide"
     34                                            style={{
     35                                                height: "7em",
     36                                                borderRadius: "1em",
     37                                                boxShadow: "0 4px 20px lightblue",
     38                                                maxWidth: "100%",
     39                                            }}
     40                                        />
     41                                    </Carousel.Item>
     42                                )
     43                            })}
     44                            {props.images.length == 0 && <Carousel.Item>
     45                                <Image
     46                                    src="https://www.tasteofhome.com/wp-content/uploads/2019/01/medium-rare-steak-shutterstock_706040446.jpg"
     47                                    style={{
     48                                        height: "7em",
     49                                        borderRadius: "1em",
     50                                        boxShadow: "0 4px 20px lightblue",
     51                                        maxWidth: "100%",
     52                                    }}
     53                                ></Image>
     54                            </Carousel.Item>}
     55                        </Carousel>
    2856                    </Col>
    2957                </Row>
  • frontend/src/Components/RestaurantDetails/TablesTable.js

    r5528b99 r07f4e8b  
    2222                </thead>
    2323                <tbody>
    24                 {Array.from(new Set(props.data.map(x => x.restaurantTable))).map((table) => {
     24                {Array.from(
     25                    new Set(props.data.map((x) => JSON.stringify(x.restaurantTable)))
     26                ).map((roomString) => JSON.parse(roomString)).map((table) => {
    2527                    return (
    2628                        <>
Note: See TracChangeset for help on using the changeset viewer.