import { Suspense, useCallback, useMemo, useRef, useState } from 'react'; import { Link, Outlet } from 'react-router-dom'; import { FloatingComposeButton } from '@/components/FloatingComposeButton'; import { TopNav } from '@/components/TopNav'; import { Skeleton } from '@/components/ui/skeleton'; import { CenterColumnContext, DrawerContext, LayoutStore, LayoutStoreContext, NavHiddenContext, useLayoutSnapshot, } from '@/contexts/LayoutContext'; import { cn } from '@/lib/utils'; /** * Persistent app shell for the fundraising-platform overhaul. * * Replaces the previous Twitter-style three-column `MainLayout` with a * GoFundMe-style top-nav-only chrome. Routes render in a single full-width * content area below the {@link TopNav}. * * Compatibility surface: * - We still provide `LayoutStoreContext`, so pages that call * `useLayoutOptions(...)` keep working. Most options (FAB, sidebars, * mobile arc) are intentionally ignored here because the new shell has * no FAB and no sidebars. The store drives two width-related escape * hatches: `wrapperClassName` (extra classes on the center column) and * `noMaxWidth` (drops the default `max-w-3xl` cap). The `fullBleed` * preset expands to both, so edge-to-edge pages keep working. * - `CenterColumnContext` exposes the content `
` so legacy components * (e.g. nsite preview overlay) can still portal into it. * - `DrawerContext` and `NavHiddenContext` are kept as no-op providers so * pages that read them don't crash. */ function PageSkeleton() { return (
); } function FundraiserLayoutInner() { const centerColumnRef = useRef(null); const [centerColumnEl, setCenterColumnEl] = useState(null); const { noMaxWidth, wrapperClassName, showFAB = false, fabKind = 1, fabHref, onFabClick, fabIcon, fabMenu } = useLayoutSnapshot(); // Mobile drawer is owned by TopNav now, so consumers of `useOpenDrawer` // become no-ops. Keeping the context shape avoids touching every page that // pulls the hook. const openDrawer = useCallback(() => {}, []); return (
}>
{ centerColumnRef.current = el; setCenterColumnEl(el); }} className={cn( 'flex-1 min-w-0 w-full mx-auto', // App-wide cap on the center column so pages like /help // don't stretch across widescreen monitors. Pages that // need a wider canvas opt out via `noMaxWidth: true` (or // the `fullBleed` preset), which expands to `!max-w-none` // through `wrapperClassName`. !noMaxWidth && 'max-w-3xl', wrapperClassName, )} >
{showFAB && (
)}
); } function SiteFooter() { return (
© {new Date().getFullYear()} Agora. Fundraisers on Nostr.
); } export function FundraiserLayout() { const store = useMemo(() => new LayoutStore(), []); return ( ); } export default FundraiserLayout;