toit msrxhe

This commit is contained in:
Your Name 2025-12-18 23:59:24 -05:00
parent 87394a44eb
commit 195b5634a1
6 changed files with 167 additions and 7 deletions

View File

@ -27,8 +27,8 @@ export async function fetchPosts(filters = {}) {
}); });
if (!res.ok) { if (!res.ok) {
console.error("fetchPosts failed", res.status); console.warn("fetchPosts failed (treated as empty)", res.status);
throw new Error("Failed to load posts"); return [];
} }
const data = await res.json(); const data = await res.json();

View File

@ -60,6 +60,54 @@ export default function MapView({
const bottomCategories = FILTER_CATEGORY_MAP[mainFilter] || ["All"]; const bottomCategories = FILTER_CATEGORY_MAP[mainFilter] || ["All"];
/* SW_SUBCAT_ICONS:BEGIN */
const getSubcatIcon = (main, sub) => {
const M = {
All: {
All: "fa-solid fa-layer-group",
},
News: {
All: "fa-solid fa-layer-group",
World: "fa-solid fa-globe",
Politics: "fa-solid fa-landmark-flag",
Tech: "fa-solid fa-microchip",
Finance: "fa-solid fa-chart-line",
Local: "fa-solid fa-location-dot",
},
Friends: {
All: "fa-solid fa-layer-group",
Nearby: "fa-solid fa-location-crosshairs",
Chats: "fa-solid fa-comments",
Groups: "fa-solid fa-user-group",
Stories: "fa-solid fa-book-open",
Favs: "fa-solid fa-heart",
},
Events: {
All: "fa-solid fa-layer-group",
Today: "fa-solid fa-calendar-day",
Weekend: "fa-solid fa-calendar-week",
Music: "fa-solid fa-music",
Sports: "fa-solid fa-football",
Local: "fa-solid fa-location-dot",
},
Market: {
All: "fa-solid fa-layer-group",
Actu: "fa-solid fa-newspaper",
Tech: "fa-solid fa-microchip",
Finan: "fa-solid fa-money-bill-trend-up",
Sport: "fa-solid fa-basketball",
Deals: "fa-solid fa-tags",
},
};
return (M[main] && M[main][sub]) || "";
};
/* SW_SUBCAT_ICONS:END */
// keep subFilter valid // keep subFilter valid
useEffect(() => { useEffect(() => {
if (!bottomCategories.length) return; if (!bottomCategories.length) return;
@ -274,7 +322,12 @@ export default function MapView({
className={"sw-bottom-item" + (subFilter === c ? " sw-bottom-active" : "")} className={"sw-bottom-item" + (subFilter === c ? " sw-bottom-active" : "")}
onClick={() => setSubFilter(c)} onClick={() => setSubFilter(c)}
> >
<div className="sw-bottom-circle">{c === "All" ? "All" : c.slice(0, 2)}</div> <div className="sw-bottom-circle">
{(() => {
const ic = getSubcatIcon(mainFilter, c);
return ic ? <i className={ic} /> : c === "All" ? "All" : c.slice(0, 2);
})()}
</div>
<div className="sw-bottom-label">{c}</div> <div className="sw-bottom-label">{c}</div>
</button> </button>
))} ))}

View File

@ -165,8 +165,8 @@ export function usePostsEngine({
} catch (err) { } catch (err) {
console.error("Erreur chargement posts:", err); console.error("Erreur chargement posts:", err);
if (!cancelled) { if (!cancelled) {
setStatus("Error loading posts."); setStatus("No posts found.");
setLoadError("Error loading posts."); setLoadError("");
setLoadingPosts(false); setLoadingPosts(false);
} }
} }

View File

@ -30,6 +30,13 @@
font-size:.78rem; font-size:.78rem;
box-shadow:0 3px 10px rgba(0,0,0,.75); box-shadow:0 3px 10px rgba(0,0,0,.75);
} }
/* SW_SUBCAT_ICON_CSS */
.sw-bottom-circle i{
font-size: 18px;
line-height: 1;
}
/* SW_SUBCAT_ICON_CSS:END */
.sw-bottom-label { font-size:.65rem; color:#e5e7eb; text-shadow:0 1px 2px rgba(0,0,0,.9); } .sw-bottom-label { font-size:.65rem; color:#e5e7eb; text-shadow:0 1px 2px rgba(0,0,0,.9); }
.sw-bottom-active .sw-bottom-circle { background: rgba(37, 99, 235, 0.82); border-color:#60a5fa; } .sw-bottom-active .sw-bottom-circle { background: rgba(37, 99, 235, 0.82); border-color:#60a5fa; }
.sw-bottom-active .sw-bottom-label { color:#bfdbfe; font-weight:600; } .sw-bottom-active .sw-bottom-label { color:#bfdbfe; font-weight:600; }
@ -52,3 +59,81 @@
} }
.sw-subcats-float .sw-bottom-row::-webkit-scrollbar{ height: 0; } .sw-subcats-float .sw-bottom-row::-webkit-scrollbar{ height: 0; }
/* SW_FILTER_ICON_VISIBILITY:BEGIN */
/* Make subcategory icons inherit color (so they show) */
.sw-bottom-item{ color:#e5e7eb; }
.sw-bottom-circle{ color:#e5e7eb; }
.sw-bottom-circle i{
color: currentColor;
font-size: 20px; /* closer to right-side icons feel */
line-height: 1;
opacity: .96;
filter: drop-shadow(0 1px 2px rgba(0,0,0,.65));
}
/* Active state: brighter icon/text like category buttons */
.sw-bottom-active .sw-bottom-circle{
color:#dbeafe;
box-shadow:0 0 14px rgba(56,189,248,.60);
border-color: rgba(96,165,250,.95);
}
.sw-bottom-active .sw-bottom-label{
color:#bfdbfe;
font-weight:700;
}
/* ---------- LIGHT THEME FIXES (readable) ---------- */
body[data-theme="light"] .sw-bottom-row{
background: rgba(255,255,255,0.95);
border: 1px solid rgba(148,163,184,0.85);
box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
body[data-theme="light"] .sw-bottom-item{ color:#0B1220; }
body[data-theme="light"] .sw-bottom-circle{
background: rgba(255,255,255,0.92);
border-color: rgba(148,163,184,0.85);
box-shadow: 0 3px 10px rgba(0,0,0,.10);
color:#0B1220;
}
body[data-theme="light"] .sw-bottom-label{
color:#0B1220;
text-shadow:none;
}
body[data-theme="light"] .sw-bottom-active .sw-bottom-circle{
background: rgba(30,107,255,0.92);
border-color: rgba(30,107,255,0.95);
color:#ffffff;
box-shadow:0 0 14px rgba(30,107,255,.35);
}
body[data-theme="light"] .sw-bottom-active .sw-bottom-label{
color:#0B1220;
font-weight:800;
}
/* Also fix right-side category buttons in light theme */
body[data-theme="light"] .sw-icon-btn{ color:#0B1220; }
body[data-theme="light"] .sw-icon-circle{
background: rgba(255,255,255,0.92);
border-color: rgba(148,163,184,0.85);
box-shadow: 0 3px 10px rgba(0,0,0,.10);
}
body[data-theme="light"] .sw-icon-label{
color:#0B1220;
text-shadow:none;
}
body[data-theme="light"] .sw-icon-active .sw-icon-circle{
background: rgba(30,107,255,0.92);
border-color: rgba(30,107,255,0.95);
box-shadow:0 0 14px rgba(30,107,255,.35);
}
body[data-theme="light"] .sw-icon-active .sw-icon-label{
color:#0B1220;
font-weight:800;
}
/* SW_FILTER_ICON_VISIBILITY:END */

View File

@ -1,5 +1,5 @@
:root{ :root{
--sw-subcats-nudge: -35px; /* subcats vertical nudge */ --sw-subcats-nudge: -45px; /* subcats vertical nudge */
--sw-below-overlap: 40px; /* wall overlaps map a bit */ --sw-below-overlap: 40px; /* wall overlaps map a bit */
} }

View File

@ -10,11 +10,14 @@
/* Small top nudge down (as requested) */ /* Small top nudge down (as requested) */
.sociowall-panel, .sociowall-panel,
.chat-panel{ .chat-panel{
max-width: 32vw;
min-width: 160px;
flex: 1 1 0; /* ✅ 1/4 */
margin-top: 5px; /* ✅ descend 5px */ margin-top: 5px; /* ✅ descend 5px */
} }
.sociowall-panel{ .sociowall-panel{
flex: 1 1 auto; flex: 3 1 0; /* ✅ 3/4 */
min-width:0; /* IMPORTANT: prevents pushing chat */ min-width:0; /* IMPORTANT: prevents pushing chat */
min-height: 160px; min-height: 160px;
background: rgba(15, 23, 42, 0.96); background: rgba(15, 23, 42, 0.96);
@ -113,3 +116,22 @@
.chat-panel{ width:100%; min-width:0; max-width:none; flex: 1 1 auto; } .chat-panel{ width:100%; min-width:0; max-width:none; flex: 1 1 auto; }
.post-list{ max-height: 46vh; } .post-list{ max-height: 46vh; }
} }
/* SW_LAYOUT_RATIO_FIX:BEGIN */
.below-row{ flex-wrap: nowrap !important; }
.sociowall-panel{
flex: 3 1 0 !important; /* ✅ 3/4 */
width: auto !important;
max-width: none !important;
min-width: 0 !important;
}
.chat-panel{
flex: 1 1 0 !important; /* ✅ 1/4 */
width: auto !important;
max-width: none !important;
min-width: 140px !important;
}
/* SW_LAYOUT_RATIO_FIX:END */