diff --git a/src/App.jsx b/src/App.jsx index 628397a..9f0ab54 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,6 +2,7 @@ import React, { Suspense, useEffect, useState, useCallback } from "react"; import { useTranslation } from "react-i18next"; import TopBar from "./components/Layout/TopBar"; import PostList from "./components/Posts/PostList"; +import ContentFilters from "./components/Filters/ContentFilters"; import IslandUniverse from "./components/Island/IslandUniverse"; import IslandViewer from "./components/Island/IslandViewer"; import ChatContainer from "./components/Chat/ChatContainer"; @@ -10,6 +11,7 @@ import { fetchIslandByUsername } from "./api/client"; const MapView = React.lazy(() => import("./components/Map/MapView")); const THEME_KEY = "sociowire:theme"; +const CONTENT_FILTER_KEY = "sociowire:contentFilter"; export default function App() { const { t } = useTranslation(); @@ -21,10 +23,30 @@ export default function App() { const [wallError, setWallError] = useState(""); const [selectedPost, setSelectedPost] = useState(null); + // Content filter (shared between map and sociowall) - persisted + // "all" | "links" | "video" | "image" | "text" | "live" | "event" + const [contentFilter, setContentFilter] = useState(() => { + try { + const saved = localStorage.getItem(CONTENT_FILTER_KEY); + if (saved && ["all", "links", "video", "image", "text", "live", "event"].includes(saved)) { + return saved; + } + } catch {} + return "all"; + }); + + // Save content filter to localStorage + useEffect(() => { + try { + localStorage.setItem(CONTENT_FILTER_KEY, contentFilter); + } catch {} + }, [contentFilter]); + // Island Universe & Island Viewer state const [showUniverse, setShowUniverse] = useState(false); const [selectedIsland, setSelectedIsland] = useState(null); + const handlePostsState = useCallback((next) => { if (!next) return; if (Array.isArray(next.posts)) setWallPosts(next.posts); @@ -158,6 +180,7 @@ export default function App() { > + {/* Content filters - shared between map and sociowall */} +
-
SOCIOWALL
+ {/* SocioWall header inside panel */} +
+

SOCIOWALL

+
- {/* CHAT PANEL SUPPRIMÉ */}
@@ -209,7 +240,7 @@ export default function App() {