mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-19 13:18:06 +02:00
- One top bar for every screen size: feeds as chips with unread counts, Focus mode, theme, add feed, and a menu for managing feeds, OPML export and logout. The article grid now uses the full page width. - New "Mes flux" dialog to rename or delete feeds (was hidden behind hover actions in the sidebar); feeds that fail to update are flagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.9 KiB
TypeScript
45 lines
1.9 KiB
TypeScript
import { Suspense, useState } from 'react';
|
|
import { lazyNamed } from '../lib/lazy';
|
|
import { TopBar } from '../components/TopBar';
|
|
import { DashboardPage } from '../pages/DashboardPage';
|
|
import { useWebsocket } from '../hooks/useWebsocket';
|
|
|
|
// Focus mode carries the gesture/animation code: load it only when used.
|
|
const FocusPage = lazyNamed(() => import('../pages/FocusPage'), 'FocusPage');
|
|
|
|
export function RootLayout() {
|
|
const [selectedFeedId, setSelectedFeedId] = useState<string | null>(null);
|
|
const [isFocusMode, setIsFocusMode] = useState(false);
|
|
|
|
// One socket for the whole session (not per page mount).
|
|
useWebsocket();
|
|
|
|
return (
|
|
<div className="flex flex-col h-dvh bg-carbon overflow-hidden">
|
|
<a href="#main-content" className="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[80] btn-primary">
|
|
Aller au contenu
|
|
</a>
|
|
{!isFocusMode && (
|
|
<TopBar selectedFeedId={selectedFeedId} onSelectFeed={setSelectedFeedId} onEnterFocus={() => setIsFocusMode(true)} />
|
|
)}
|
|
|
|
<div id="main-content" className="flex-1 flex flex-col min-h-0">
|
|
{/* Kept mounted in focus mode so the list keeps its scroll position. */}
|
|
<DashboardPage selectedFeedId={selectedFeedId} hidden={isFocusMode} />
|
|
</div>
|
|
|
|
{isFocusMode && (
|
|
<Suspense
|
|
fallback={
|
|
<div className="fixed inset-0 z-50 bg-carbon flex items-center justify-center" role="status" aria-label="Chargement">
|
|
<div className="w-12 h-12 border-2 border-nature/20 border-t-nature rounded-full animate-spin" />
|
|
</div>
|
|
}
|
|
>
|
|
<FocusPage onExit={() => setIsFocusMode(false)} />
|
|
</Suspense>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|