Skip to content

Commit d516366

Browse files
Merge pull request #3363 from OneCommunityGlobal/bhavpreet_carousel_fix
Bhavpreet - changed custom carousel to that of bootstraps
2 parents dfb7643 + 42ac941 commit d516366

4 files changed

Lines changed: 22 additions & 124 deletions

File tree

src/components/LBDashboard/ListingOverview/ImageCarousel.css

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/components/LBDashboard/ListingOverview/ImageCarousel.jsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/components/LBDashboard/ListingOverview/ListOverview.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useEffect } from 'react';
22
import './Listoverview.css';
3+
import Carousel from 'react-bootstrap/Carousel';
34
import logo from '../../../assets/images/logo2.png';
45
import mapIcon from '../../../assets/images/mapIcon.png';
5-
import ImageCarousel from './ImageCarousel';
66

77
function ListOverview() {
88
const [listing, setListing] = React.useState({});
@@ -37,20 +37,27 @@ function ListOverview() {
3737
<h1>{listing.title}</h1>
3838
</div>
3939
<div className="image-carousel">
40-
<ImageCarousel images={listing.images} />
40+
<Carousel>
41+
{listing.images?.map((image, index) => (
42+
<Carousel.Item key={image}>
43+
<img className="d-block w-100" src={image} alt={`Slide ${index + 1}`} />
44+
</Carousel.Item>
45+
))}
46+
</Carousel>
4147
</div>
48+
4249
<div className="amenities">
4350
<div>
4451
<h2>Available amenities in this unit:</h2>
45-
<ol>
52+
<ol className="amenities-list">
4653
{listing.unitAmenities?.map(amenity => (
4754
<li key={amenity}>{amenity}</li>
4855
))}
4956
</ol>
5057
</div>
5158
<div>
5259
<h2>Village level amenities:</h2>
53-
<ol>
60+
<ol className="amenities-list">
5461
{listing.villageAmenities?.map(amenity => (
5562
<li key={amenity}>{amenity}</li>
5663
))}

src/components/LBDashboard/ListingOverview/Listoverview.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@
7575
margin-bottom: 2.5%;
7676
}
7777

78+
.image-carousel img {
79+
width: 100%;
80+
height: auto;
81+
object-fit: cover;
82+
max-width: 100%;
83+
flex-shrink: 0;
84+
}
85+
86+
7887
.amenities {
7988
display: flex;
8089
justify-content: center;
@@ -96,12 +105,12 @@
96105
padding-left: 5%;
97106
}
98107

99-
ol {
108+
.amenities-list {
100109
display: flex;
101110
flex-direction: column;
102111
list-style-position: inside;
103112
}
104-
li {
113+
.amenities-list li {
105114
margin: 0;
106115
}
107116

0 commit comments

Comments
 (0)