Changeset 07f4e8b for frontend/src/Components/RestaurantDetails
- Timestamp:
- 01/24/24 17:42:28 (10 months ago)
- Branches:
- master
- Children:
- 0f5aa27
- Parents:
- 5528b99
- Location:
- frontend/src/Components/RestaurantDetails
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/RestaurantDetails/Carousel.js
r5528b99 r07f4e8b 12 12 <Row className='d-flex justify-content-center align-items-center'><h2>Мени</h2></Row> 13 13 <hr className='m-2'></hr> 14 <Menu menu={props.menu}></Menu>14 <Menu images={props.images} menu={props.menu}></Menu> 15 15 </> 16 16 ); -
frontend/src/Components/RestaurantDetails/Menu.js
r5528b99 r07f4e8b 23 23 24 24 25 26 25 27 return (<> 26 28 <Carousel activeIndex={ind} onSelect={handleSelect} indicators={false}> … … 34 36 return ( 35 37 <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}/> 37 42 </Col> 38 43 ) -
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> -
frontend/src/Components/RestaurantDetails/TablesTable.js
r5528b99 r07f4e8b 22 22 </thead> 23 23 <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) => { 25 27 return ( 26 28 <>
Note:
See TracChangeset
for help on using the changeset viewer.