[APP-1357] profile header follow recommendations (#8784)

This commit is contained in:
Caidan
2025-08-21 11:56:17 -07:00
committed by GitHub
parent d900d0b7a7
commit eabcd9150d
8 changed files with 463 additions and 314 deletions
@@ -0,0 +1,45 @@
import {AccordionAnimation} from '#/lib/custom-animations/AccordionAnimation'
import {useGate} from '#/lib/statsig/statsig'
import {isAndroid} from '#/platform/detection'
import {useSuggestedFollowsByActorQuery} from '#/state/queries/suggested-follows'
import {ProfileGrid} from '#/components/FeedInterstitials'
export function ProfileHeaderSuggestedFollows({actorDid}: {actorDid: string}) {
const {isLoading, data, error} = useSuggestedFollowsByActorQuery({
did: actorDid,
})
return (
<ProfileGrid
isSuggestionsLoading={isLoading}
profiles={data?.suggestions ?? []}
recId={data?.recId}
error={error}
viewContext="profileHeader"
/>
)
}
export function AnimatedProfileHeaderSuggestedFollows({
isExpanded,
actorDid,
}: {
isExpanded: boolean
actorDid: string
}) {
const gate = useGate()
if (!gate('post_follow_profile_suggested_accounts')) return null
/* NOTE (caidanw):
* Android does not work well with this feature yet.
* This issue stems from Android not allowing dragging on clickable elements in the profile header.
* Blocking the ability to scroll on Android is too much of a trade-off for now.
**/
if (isAndroid) return null
return (
<AccordionAnimation isExpanded={isExpanded}>
<ProfileHeaderSuggestedFollows actorDid={actorDid} />
</AccordionAnimation>
)
}