diff options
Diffstat (limited to 'src/screens/StarterPack/StarterPackScreen.tsx')
-rw-r--r-- | src/screens/StarterPack/StarterPackScreen.tsx | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/screens/StarterPack/StarterPackScreen.tsx b/src/screens/StarterPack/StarterPackScreen.tsx index d89bda137..bdf6f9dbe 100644 --- a/src/screens/StarterPack/StarterPackScreen.tsx +++ b/src/screens/StarterPack/StarterPackScreen.tsx @@ -55,6 +55,7 @@ import * as Prompt from '#/components/Prompt' import {ReportDialog, useReportDialogControl} from '#/components/ReportDialog' import {RichText} from '#/components/RichText' import {FeedsList} from '#/components/StarterPack/Main/FeedsList' +import {PostsList} from '#/components/StarterPack/Main/PostsList' import {ProfilesList} from '#/components/StarterPack/Main/ProfilesList' import {QrCodeDialog} from '#/components/StarterPack/QrCodeDialog' import {ShareDialog} from '#/components/StarterPack/ShareDialog' @@ -132,9 +133,14 @@ function StarterPackScreenInner({ > moderationOpts: ModerationOpts }) { + const showPeopleTab = Boolean(starterPack.list) + const showFeedsTab = Boolean(starterPack.feeds?.length) + const showPostsTab = Boolean(starterPack.list) + const tabs = [ - ...(starterPack.list ? ['People'] : []), - ...(starterPack.feeds?.length ? ['Feeds'] : []), + ...(showPeopleTab ? ['People'] : []), + ...(showFeedsTab ? ['Feeds'] : []), + ...(showPostsTab ? ['Posts'] : []), ] const qrCodeDialogControl = useDialogControl() @@ -180,10 +186,9 @@ function StarterPackScreenInner({ onOpenShareDialog={onOpenShareDialog} /> )}> - {starterPack.list != null + {showPeopleTab ? ({headerHeight, scrollElRef}) => ( <ProfilesList - key={0} // Validated above listUri={starterPack!.list!.uri} headerHeight={headerHeight} @@ -194,10 +199,9 @@ function StarterPackScreenInner({ /> ) : null} - {starterPack.feeds != null + {showFeedsTab ? ({headerHeight, scrollElRef}) => ( <FeedsList - key={1} // @ts-expect-error ? feeds={starterPack?.feeds} headerHeight={headerHeight} @@ -206,6 +210,18 @@ function StarterPackScreenInner({ /> ) : null} + {showPostsTab + ? ({headerHeight, scrollElRef}) => ( + <PostsList + // Validated above + listUri={starterPack!.list!.uri} + headerHeight={headerHeight} + // @ts-expect-error + scrollElRef={scrollElRef} + moderationOpts={moderationOpts} + /> + ) + : null} </PagerWithHeader> </View> |