Skip to content

Commit 2dc59a1

Browse files
committed
Fix image path using Vite BASE_URL
1 parent da22000 commit 2dc59a1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/ImageGallery.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const ImageGallery = ({picture}) =>{
1313
{picture.map((image, index) => (
1414
<img
1515
key={index}
16-
src={image}
16+
src={`${import.meta.env.BASE_URL}${image}`}
1717
alt="property view"
1818
onClick={() => setMainImage(image)}
1919
/>

src/components/PropertyCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const PropertyCard = ({property, onAddToFavourites}) => {
77
<div className="Property-card">
88

99
<Link to={`/property/${property.id}`}>
10-
<img src={property.picture[0]} alt="property" />
10+
<img src={`${import.meta.env.BASE_URL}${property.picture[0]}`} alt="property" />
1111
</Link>
1212

1313

0 commit comments

Comments
 (0)