Ignore:
Timestamp:
02/04/24 16:57:49 (5 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
efaa053
Parents:
07f4e8b
Message:

ouath, mailing impl

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";
     1import {Col, Container, Image, Row, Button, Badge} from "react-bootstrap";
    22import {BsFillPersonFill} from "react-icons/bs";
    33import {MdOutlineLocalOffer} from "react-icons/md";
     
    55
    66function 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
    719    console.log(props)
     20    const randomInt = Math.floor(Math.random() * (3)) + 1;
    821    return (
    922        <>
     
    1528                    boxShadow: "0 3px 5px lightblue",
    1629                    maxWidth: "60%",
     30                    backgroundColor: props.data.promoted ? "#e1f7fa" : ""
    1731                }}
    1832            >
     
    3145                    <Col>
    3246                        <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>
    3451                        </Row>
    3552                        <Row>
     
    90107                                >
    91108                                    <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>
    93111                                    </Row>
    94112                                    <Row className="w-100">
Note: See TracChangeset for help on using the changeset viewer.