From 7ee7d968e58897eaf43c55ebd12987a3cf3751b0 Mon Sep 17 00:00:00 2001 From: Ansh Date: Sun, 2 Jul 2023 19:30:02 +0100 Subject: [PATCH] [APP-708] Onboarding revamp (#939) * Move Discover New Feeds button to the top of the MultiFeed * add discover custom feeds to empty following page --- src/state/models/discovery/foafs.ts | 2 +- src/view/com/posts/FollowingEmptyState.tsx | 21 +++++++++++++++++++++ src/view/com/posts/MultiFeed.tsx | 18 +++++++++++++++--- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/state/models/discovery/foafs.ts b/src/state/models/discovery/foafs.ts index 4bbd3280..4b25ed4a 100644 --- a/src/state/models/discovery/foafs.ts +++ b/src/state/models/discovery/foafs.ts @@ -19,7 +19,7 @@ export class FoafsModel { isLoading = false hasData = false sources: string[] = [] - foafs: Map = new Map() + foafs: Map = new Map() // FOAF stands for Friend of a Friend popular: RefWithInfoAndFollowers[] = [] constructor(public rootStore: RootStoreModel) { diff --git a/src/view/com/posts/FollowingEmptyState.tsx b/src/view/com/posts/FollowingEmptyState.tsx index d1843900..4491b252 100644 --- a/src/view/com/posts/FollowingEmptyState.tsx +++ b/src/view/com/posts/FollowingEmptyState.tsx @@ -27,6 +27,10 @@ export function FollowingEmptyState() { } }, [navigation]) + const onPressDiscoverFeeds = React.useCallback(() => { + navigation.navigate('DiscoverFeeds') + }, [navigation]) + return ( @@ -48,6 +52,23 @@ export function FollowingEmptyState() { size={14} /> + + + You can also discover new Custom Feeds to follow. + + ) } diff --git a/src/view/com/posts/MultiFeed.tsx b/src/view/com/posts/MultiFeed.tsx index dc28d2d8..466a7a47 100644 --- a/src/view/com/posts/MultiFeed.tsx +++ b/src/view/com/posts/MultiFeed.tsx @@ -142,7 +142,7 @@ export const MultiFeed = observer(function Feed({ [showPostFollowBtn, pal], ) - const FeedFooter = React.useCallback( + const ListFooter = React.useCallback( () => multifeed.isLoading && !isRefreshing ? ( @@ -154,6 +154,17 @@ export const MultiFeed = observer(function Feed({ [multifeed.isLoading, isRefreshing, pal], ) + const ListHeader = React.useCallback(() => { + return ( + + + + Discover new feeds + + + ) + }, [pal]) + return ( {multifeed.items.length > 0 && ( @@ -163,7 +174,8 @@ export const MultiFeed = observer(function Feed({ data={multifeed.items} keyExtractor={item => item._reactKey} renderItem={renderItem} - ListFooterComponent={FeedFooter} + ListFooterComponent={ListFooter} + ListHeaderComponent={ListHeader} refreshControl={