-
+
+
+
-
-
-
>
);
}
diff --git a/src/components/map/Map.js b/src/components/map/Map.js
index b95f4c7..9847c89 100644
--- a/src/components/map/Map.js
+++ b/src/components/map/Map.js
@@ -16,7 +16,8 @@ L.Icon.Default.mergeOptions({
});
// Default center coordinates: 29°47'40.3"N 95°49'29.1"W (Katy, TX)
-const center = [29.7945, -95.8248];
+// 29.939345, -95.304114
+const center = [29.730367, -95.578197];
function MapEventHandler({ onBoundsChange, isZoomingRef, mapRef }) {
const map = useMap();
@@ -60,6 +61,7 @@ function Map() {
const mapRef = useRef(null);
const markersRef = useRef([]);
const isZoomingRef = useRef(false);
+ const markerRefs = useRef({});
useEffect(() => {
const validResources = resourcesData.filter(
@@ -99,18 +101,24 @@ function Map() {
}, []);
const handleResourceClick = (resource) => {
- if (mapRef.current) {
- isZoomingRef.current = true;
+ if (!mapRef.current) return;
- mapRef.current.flyTo([resource.lat, resource.lng], 16, {
- animate: true,
- duration: 0.8,
- });
+ isZoomingRef.current = true;
- setTimeout(() => {
- isZoomingRef.current = false;
- }, 900);
- }
+ const map = mapRef.current;
+
+ map.once("moveend", () => {
+ const marker = markerRefs.current[resource.id];
+ if (marker) {
+ marker.openPopup();
+ }
+ isZoomingRef.current = false;
+ });
+
+ map.flyTo([resource.lat, resource.lng], 16, {
+ animate: true,
+ duration: 0.8,
+ });
};
return (
@@ -131,7 +139,7 @@ function Map() {
{
+ if (ref && marker.resource.id) {
+ markerRefs.current[marker.resource.id] = ref;
+ }
+ }}
>
diff --git a/src/components/resources/ResourcesList.js b/src/components/resources/ResourcesList.js
index c1e927f..34f1c45 100644
--- a/src/components/resources/ResourcesList.js
+++ b/src/components/resources/ResourcesList.js
@@ -104,7 +104,7 @@ export default function ResourcesList() {
>
-
{r.name}
+
{r.name}
{r.category}
@@ -119,18 +119,6 @@ export default function ResourcesList() {
))}
-
-
-
- {r.phone ? {r.phone} : null}
-
- {r.website ? (
-
- Visit site →
-
- ) : null}
-
-
{r.hours || r.eligibility ? (
{r.hours ? (
@@ -145,6 +133,17 @@ export default function ResourcesList() {
) : null}
) : null}
+
+
+
+ {r.phone ? {r.phone} : null}
+
+ {r.website ? (
+
+ Visit site →
+
+ ) : null}
+
);
diff --git a/src/components/styles/pages.css b/src/components/styles/pages.css
index 07bd4f6..33b7b82 100644
--- a/src/components/styles/pages.css
+++ b/src/components/styles/pages.css
@@ -44,6 +44,7 @@
display: grid;
gap: 14px;
width: 100%;
+ grid-template-columns: 1fr;
}
.resources-container {
@@ -83,7 +84,19 @@
@media (min-width: 720px) {
.card-grid {
- grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+}
+
+@media (min-width: 1024px) {
+ .card-grid {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ }
+}
+
+@media (min-width: 1200px) {
+ .card-grid {
+ grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
.filter-bar{
@@ -215,6 +228,14 @@
align-items: center;
}
+.info-card .meta-row {
+ margin-top: auto;
+}
+
+.info-card .card-title {
+ font-weight: 700;
+}
+
.info-card .muted {
opacity: 0.8;
font-family: 'DIN Condensed Web';