web issue fixes
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
function getStoreImage(store) {
|
||||
if (store.imageUrl) return store.imageUrl;
|
||||
const name = store.storeName?.toLowerCase() ?? "";
|
||||
if (name.includes("downtown")) return "/stores/downtown.webp";
|
||||
if (name.includes("north")) return "/stores/north.webp";
|
||||
if (name.includes("west")) return "/stores/west.webp";
|
||||
return "/images/pet-placeholder.png";
|
||||
}
|
||||
|
||||
export default function ContactPage() {
|
||||
const [locations, setLocations] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -52,7 +61,7 @@ export default function ContactPage() {
|
||||
<article key={location.storeId} className="info-mini-card location-card">
|
||||
<div className="location-card-image-wrapper">
|
||||
<img
|
||||
src={location.imageUrl || "/images/pet-placeholder.png"}
|
||||
src={getStoreImage(location)}
|
||||
alt={location.storeName}
|
||||
className="location-card-image"
|
||||
onError={(e) => {
|
||||
|
||||
Reference in New Issue
Block a user