source: frontend/src/Components/RestaurantDetails/MenuItem.js@ 07f4e8b

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

prefinal fixes

  • Property mode set to 100644
File size: 3.3 KB
Line 
1import React from "react";
2import {Col, Row, Image, Container} from "react-bootstrap";
3import Carousel from "react-bootstrap/Carousel";
4
5const MenuItem = (props) => {
6
7 const data = props.data;
8 console.log("dva orla")
9 console.log(props)
10 return (<>
11
12 <a href="#" style={{textDecoration: "none", color: "black"}}>
13 <Container className="py-3 px-1 my-4"
14 style={{
15 border: "4px solid #159895",
16 borderRadius: "1em",
17 boxShadow: "0 3px 5px #159895",
18 maxWidth: "90%"
19 }}>
20 <Row>
21 <Col className="d-flex justify-content-center mb-3">
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>
56 </Col>
57 </Row>
58 <Row>
59 <Col className="d-flex flex-column justify-content-center " style={{textAlign: "center"}}>
60 <h4>{data.name}</h4>
61 <h6>{data.ingredients}</h6>
62 </Col>
63 </Row>
64 <Row>
65 <Col className="d-flex flex-column justify-content-center align-content-center">
66
67 <h5>Цена: {data.price}$</h5>
68 </Col>
69 </Row>
70 </Container>
71 </a>
72
73 </>)
74}
75
76export default MenuItem;
Note: See TracBrowser for help on using the repository browser.