From d60a8f26c4fd14b7dc8274b7b6b0a70da7fa6859 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 12 Sep 2024 16:34:10 -0500 Subject: [PATCH] Suggested follows by actor (on profiles) updates (#5243) * If fallback, return nothing * Compress size a bit * Hide on own profile * Match load state * Remove gcTime * Filter out followed users * Feedback --- src/components/FeedInterstitials.tsx | 64 ++++++++++++++------------ src/components/ProfileCard.tsx | 39 +++++++++------- src/state/queries/suggested-follows.ts | 7 ++- 3 files changed, 61 insertions(+), 49 deletions(-) diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx index 5031f584..286ded13 100644 --- a/src/components/FeedInterstitials.tsx +++ b/src/components/FeedInterstitials.tsx @@ -60,16 +60,13 @@ function CardOuter({ export function SuggestedFollowPlaceholder() { const t = useTheme() return ( - + + - - - - - + ) } @@ -176,9 +173,14 @@ function useExperimentalSuggestedUsersQuery() { } export function SuggestedFollows({feed}: {feed: FeedDescriptor}) { - const [feedType, feedUri] = feed.split('|') + const {currentAccount} = useSession() + const [feedType, feedUriOrDid] = feed.split('|') if (feedType === 'author') { - return + if (currentAccount?.did === feedUriOrDid) { + return null + } else { + return + } } else { return } @@ -197,6 +199,7 @@ export function SuggestedFollowsProfile({did}: {did: string}) { isSuggestionsLoading={isSuggestionsLoading} profiles={data?.suggestions ?? []} error={error} + viewContext="profile" /> ) } @@ -212,6 +215,7 @@ export function SuggestedFollowsHome() { isSuggestionsLoading={isSuggestionsLoading} profiles={profiles} error={error} + viewContext="feed" /> ) } @@ -220,10 +224,12 @@ export function ProfileGrid({ isSuggestionsLoading, error, profiles, + viewContext = 'feed', }: { isSuggestionsLoading: boolean profiles: AppBskyActorDefs.ProfileViewDetailed[] error: Error | null + viewContext: 'profile' | 'feed' }) { const t = useTheme() const {_} = useLingui() @@ -280,7 +286,7 @@ export function ProfileGrid({ shape="round" /> - + )} @@ -297,33 +303,31 @@ export function ProfileGrid({ return ( - - - Suggested for you + + + {viewContext === 'profile' ? ( + Similar accounts + ) : ( + Suggested for you + )} - + {gtMobile ? ( - - + + {content} - + - + {content}