From 14ffa8f7e45eb06fdd98e804dbe4122b212ca17d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 27 Feb 2026 11:24:56 -0600 Subject: [PATCH] Fix FAB on Webxdc page by passing onFabClick through KindFeedPage KindFeedPage's own useLayoutOptions was overwriting the onFabClick set by WebxdcFeedPage. Now onFabClick is a KindFeedPage prop that gets forwarded to useLayoutOptions, so only one call wins. --- src/pages/KindFeedPage.tsx | 6 ++++-- src/pages/WebxdcFeedPage.tsx | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/KindFeedPage.tsx b/src/pages/KindFeedPage.tsx index 3d404365..0dccfe64 100644 --- a/src/pages/KindFeedPage.tsx +++ b/src/pages/KindFeedPage.tsx @@ -24,9 +24,11 @@ interface KindFeedPageProps { tagFilters?: Record; /** Extra content rendered after the feed header (e.g. a custom compose dialog). */ extra?: React.ReactNode; + /** If set, overrides the default FAB click behavior. */ + onFabClick?: () => void; } -export function KindFeedPage({ kind, title, icon, emptyMessage, kindDef, backTo = '/', alwaysShowBack, fabHref, tagFilters, extra }: KindFeedPageProps) { +export function KindFeedPage({ kind, title, icon, emptyMessage, kindDef, backTo = '/', alwaysShowBack, fabHref, tagFilters, extra, onFabClick }: KindFeedPageProps) { const primaryKind = Array.isArray(kind) ? kind[0] : kind; const resolvedDef = useMemo( @@ -39,7 +41,7 @@ export function KindFeedPage({ kind, title, icon, emptyMessage, kindDef, backTo description: `${title} on Nostr`, }); - useLayoutOptions({ showFAB: true, fabKind: primaryKind, fabHref }); + useLayoutOptions({ showFAB: true, fabKind: primaryKind, fabHref, onFabClick }); const kinds = Array.isArray(kind) ? kind : [kind]; diff --git a/src/pages/WebxdcFeedPage.tsx b/src/pages/WebxdcFeedPage.tsx index 8a36cbb6..0f25c8f2 100644 --- a/src/pages/WebxdcFeedPage.tsx +++ b/src/pages/WebxdcFeedPage.tsx @@ -1,6 +1,5 @@ import { useState, useCallback } from 'react'; import { Blocks } from 'lucide-react'; -import { useLayoutOptions } from '@/contexts/LayoutContext'; import { KindFeedPage } from '@/pages/KindFeedPage'; import { WebxdcUploadDialog } from '@/components/WebxdcUploadDialog'; @@ -13,14 +12,13 @@ export function WebxdcFeedPage() { setUploadOpen(true); }, []); - useLayoutOptions({ showFAB: true, fabKind: 1063, onFabClick: handleFabClick }); - return ( } tagFilters={TAG_FILTERS} + onFabClick={handleFabClick} emptyMessage="No webxdc apps found yet. Check your relay connections or try again later." extra={} />