Changeset 07f4e8b for frontend/src/Components/RestaurantDetails/MenuItem.js
- Timestamp:
- 01/24/24 17:42:28 (8 months ago)
- Branches:
- master
- Children:
- 0f5aa27
- Parents:
- 5528b99
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/RestaurantDetails/MenuItem.js
r5528b99 r07f4e8b 1 1 import React from "react"; 2 2 import {Col, Row, Image, Container} from "react-bootstrap"; 3 import Carousel from "react-bootstrap/Carousel"; 3 4 4 5 const MenuItem = (props) => { 5 6 6 7 const data = props.data; 8 console.log("dva orla") 9 console.log(props) 7 10 return (<> 8 11 … … 17 20 <Row> 18 21 <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> 28 56 </Col> 29 57 </Row>
Note:
See TracChangeset
for help on using the changeset viewer.