update frontend

This commit is contained in:
Your Name 2025-12-22 02:10:45 -05:00
parent c043dbf8dc
commit d25bbf21a2
1 changed files with 17 additions and 20 deletions

View File

@ -2,7 +2,6 @@ import React, { Suspense, useEffect, useState, useCallback } from "react";
import TopBar from "./components/Layout/TopBar"; import TopBar from "./components/Layout/TopBar";
import PostList from "./components/Posts/PostList"; import PostList from "./components/Posts/PostList";
// Lazy-load de la carte (gros chunk : maplibre, CSS, etc.)
const MapView = React.lazy(() => import("./components/Map/MapView")); const MapView = React.lazy(() => import("./components/Map/MapView"));
const THEME_KEY = "sociowire:theme"; const THEME_KEY = "sociowire:theme";
@ -69,7 +68,7 @@ export default function App() {
} catch {} } catch {}
}, [activeChats]); }, [activeChats]);
// Ouvrir un chat (simulé ici par un clic sur Contacts) // Ouvrir un chat
const openChat = (name) => { const openChat = (name) => {
if (!activeChats.includes(name)) { if (!activeChats.includes(name)) {
setActiveChats(prev => [...prev, name]); setActiveChats(prev => [...prev, name]);
@ -111,27 +110,25 @@ export default function App() {
<div style={{ height: 18 }} /> <div style={{ height: 18 }} />
{/* Barre dynamique transparente : apparaît seulement sil y a des chats */} {/* Barre toujours visible, se remplit progressivement */}
{activeChats.length > 0 && ( <div className="bottom-bar">
<div className="bottom-bar"> <div className="bottom-left">
<div className="bottom-left"> {activeChats.map((name, idx) => (
{activeChats.map((name, idx) => ( <div key={idx} className="bottom-chat">
<div key={idx} className="bottom-chat"> <div className="chat-avatar">👤</div>
<div className="chat-avatar">👤</div> <span className="chat-name">{name}</span>
<span className="chat-name">{name}</span> <button className="bottom-remove" onClick={() => setActiveChats(prev => prev.filter(n => n !== name))}></button>
<button className="bottom-remove" onClick={() => setActiveChats(prev => prev.filter(n => n !== name))}></button>
</div>
))}
</div>
<div className="bottom-right">
<div className="bottom-contact" onClick={() => openChat("Contacts")}>
<span className="contact-icon">👥</span>
<span className="contact-text">Contacts</span>
<span className="contact-online">34/84</span>
</div> </div>
))}
</div>
<div className="bottom-right">
<div className="bottom-contact" onClick={() => openChat("Contacts")}>
<span className="contact-icon">👥</span>
<span className="contact-text">Contacts</span>
<span className="contact-online">34/84</span>
</div> </div>
</div> </div>
)} </div>
</div> </div>
</div> </div>
); );