update frontend

This commit is contained in:
Your Name 2025-12-09 19:54:35 -05:00
parent 1b9d71639b
commit 8e60ad833f
2 changed files with 26 additions and 22 deletions

View File

@ -247,19 +247,29 @@ export default function MapView() {
} }
}, [mainFilter, bottomCategories, subFilter]); }, [mainFilter, bottomCategories, subFilter]);
/* ================= MARKERS & TIME FILTER ================= */ /* ================= MARKERS & FILTERS ================= */
const rebuildMarkersForTimeFilter = (tf) => { const rebuildMarkersForFilters = (tf) => {
const map = mapRef.current; const map = mapRef.current;
if (!map) return; if (!map) return;
clearAllMarkers(markersRef, expandedElRef); clearAllMarkers(markersRef, expandedElRef);
const posts = allPostsRef.current || []; const posts = allPostsRef.current || [];
const catCode = categoryCode(mainFilter);
const visible = posts.filter((p) => const visible = posts.filter((p) => {
matchesTimeFilter(p.created_at || p.CreatedAt, tf) // catégorie
); if (catCode) {
const pc = (p.category || p.Category || "").toString().toUpperCase();
if (pc !== catCode) return false;
}
// sous-catégorie
if (!matchesSubFilter(p, subFilter)) return false;
// temps
if (!matchesTimeFilter(p.created_at || p.CreatedAt, tf)) return false;
return true;
});
visible.forEach((post) => { visible.forEach((post) => {
createMarkerForPost(post, mapRef, markersRef, expandedElRef); createMarkerForPost(post, mapRef, markersRef, expandedElRef);
@ -342,7 +352,7 @@ export default function MapView() {
filterKey, filterKey,
}; };
rebuildMarkersForTimeFilter(timeFilter); rebuildMarkersForFilters(timeFilter);
setLoadingPosts(false); setLoadingPosts(false);
} catch (err) { } catch (err) {
console.error("Erreur chargement posts:", err); console.error("Erreur chargement posts:", err);
@ -363,7 +373,7 @@ export default function MapView() {
}, [viewParams, mainFilter, subFilter]); }, [viewParams, mainFilter, subFilter]);
useEffect(() => { useEffect(() => {
rebuildMarkersForTimeFilter(timeFilter); rebuildMarkersForFilters(timeFilter);
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [timeFilter]); }, [timeFilter]);
@ -393,12 +403,9 @@ export default function MapView() {
const p = msg.post; const p = msg.post;
const catCode = categoryCode(mainFilter); const catCode = categoryCode(mainFilter);
if ( if (catCode) {
catCode && const pc = (p.category || p.Category || "").toString().toUpperCase();
p.category && if (pc !== catCode) return;
p.category.toUpperCase() !== catCode
) {
return;
} }
if (!matchesSubFilter(p, subFilter)) return; if (!matchesSubFilter(p, subFilter)) return;
@ -727,7 +734,7 @@ export default function MapView() {
</div> </div>
)} )}
{/* SOCIOWALL + CHAT EN BAS */} {/* SOCIOWALL + CHAT EN BAS (overlay) */}
<div className="map-overlay map-overlay-wall"> <div className="map-overlay map-overlay-wall">
<div className="sociowall-panel"> <div className="sociowall-panel">
<div className="sociowall-header">Sociowall</div> <div className="sociowall-header">Sociowall</div>

View File

@ -11,10 +11,7 @@
gap: 0.6rem; gap: 0.6rem;
align-items: stretch; align-items: stretch;
pointer-events: none; pointer-events: none;
/* IMPORTANT : z-index: 10; /* plus bas que les autres overlays */
z-index plus bas que les autres overlays (20)
pour que les filtres restent au-dessus si ça se chevauche */
z-index: 10;
} }
.map-overlay-wall * { .map-overlay-wall * {
@ -25,8 +22,8 @@
.sociowall-panel { .sociowall-panel {
flex: 1.5; flex: 1.5;
min-height: 90px; /* plus compact */ min-height: 90px;
max-height: 170px; /* nempiète pas trop sur la map */ max-height: 150px; /* hauteur bloquée → nenvahit pas la map */
background: rgba(15, 23, 42, 0.96); background: rgba(15, 23, 42, 0.96);
border-radius: 14px; border-radius: 14px;
border: 1px solid rgba(148, 163, 184, 0.9); border: 1px solid rgba(148, 163, 184, 0.9);
@ -51,7 +48,7 @@
.post-list { .post-list {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto; /* cest ici que ça scrolle */
padding-right: 0.15rem; padding-right: 0.15rem;
} }
@ -145,7 +142,7 @@
.chat-panel { .chat-panel {
width: 150px; width: 150px;
min-width: 130px; min-width: 130px;
max-height: 170px; /* même hauteur que le wall */ max-height: 150px;
background: rgba(15, 23, 42, 0.96); background: rgba(15, 23, 42, 0.96);
border-radius: 14px; border-radius: 14px;
border: 1px solid rgba(148, 163, 184, 0.9); border: 1px solid rgba(148, 163, 184, 0.9);