Changeset 0f5aa27 for frontend/src/Components/Listings
- Timestamp:
- 02/04/24 16:57:49 (10 months ago)
- Branches:
- master
- Children:
- efaa053
- Parents:
- 07f4e8b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Listings/HotelListing.js
r07f4e8b r0f5aa27 1 import {Col, Container, Image, Row, Button } from "react-bootstrap";1 import {Col, Container, Image, Row, Button, Badge} from "react-bootstrap"; 2 2 import {BsFillPersonFill} from "react-icons/bs"; 3 3 import {MdOutlineLocalOffer} from "react-icons/md"; … … 5 5 6 6 function HotelListing(props) { 7 8 const getMarketingMessage = (num) => { 9 switch (num){ 10 case 1: 11 return "Достапно само денес" 12 case 2: 13 return "Последна соба" 14 case 3: 15 return "Специјална цена" 16 } 17 } 18 7 19 console.log(props) 20 const randomInt = Math.floor(Math.random() * (3)) + 1; 8 21 return ( 9 22 <> … … 15 28 boxShadow: "0 3px 5px lightblue", 16 29 maxWidth: "60%", 30 backgroundColor: props.data.promoted ? "#e1f7fa" : "" 17 31 }} 18 32 > … … 31 45 <Col> 32 46 <Row> 33 <h3>{props.data.hotelName}</h3> 47 <h3>{props.data.hotelName} 48 {props.data.marketed && randomInt !== 3 && <h6><Badge bg="warning">{getMarketingMessage(randomInt)}</Badge></h6>} 49 {props.data.promoted && <h6><Badge bg="primary">Најпопуларно</Badge></h6>} 50 </h3> 34 51 </Row> 35 52 <Row> … … 90 107 > 91 108 <Row> 92 <h4>{props.data.totalPrice}$</h4> 109 <h4>{props.data.marketed && randomInt === 3 && <h6><Badge bg="warning">{getMarketingMessage(randomInt)}</Badge></h6>} 110 {props.data.totalPrice}$</h4> 93 111 </Row> 94 112 <Row className="w-100">
Note:
See TracChangeset
for help on using the changeset viewer.