From 0983aa9ba2e31816b8f200bfd77c7b2b95c932d4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 22 Dec 2025 02:07:22 -0500 Subject: [PATCH] update frontend --- src/App.jsx | 58 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 2e993b2..d988952 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,6 +6,7 @@ import PostList from "./components/Posts/PostList"; const MapView = React.lazy(() => import("./components/Map/MapView")); const THEME_KEY = "sociowire:theme"; +const ACTIVE_CHATS_KEY = "sociowire:activeChats"; export default function App() { const [theme, setTheme] = useState("blue"); @@ -52,6 +53,29 @@ export default function App() { } }, [theme]); + // Chats actifs (s'ajoutent quand on clique sur Contacts) + const [activeChats, setActiveChats] = useState([]); + + useEffect(() => { + try { + const saved = localStorage.getItem(ACTIVE_CHATS_KEY); + if (saved) setActiveChats(JSON.parse(saved)); + } catch {} + }, []); + + useEffect(() => { + try { + localStorage.setItem(ACTIVE_CHATS_KEY, JSON.stringify(activeChats)); + } catch {} + }, [activeChats]); + + // Ouvrir un chat (simulé ici par un clic sur Contacts) + const openChat = (name) => { + if (!activeChats.includes(name)) { + setActiveChats(prev => [...prev, name]); + } + }; + return (
@@ -81,20 +105,34 @@ export default function App() { onSelectPost={setSelectedPost} />
- -
-
CHAT
- -
+ {/* CHAT PANEL SUPPRIMÉ */}
+ + {/* Barre dynamique transparente : apparaît seulement s’il y a des chats */} + {activeChats.length > 0 && ( +
+
+ {activeChats.map((name, idx) => ( +
+
👤
+ {name} + +
+ ))} +
+
+
openChat("Contacts")}> + 👥 + Contacts + 34/84 +
+
+
+ )}
); -} +} \ No newline at end of file