Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok committed Jan 16, 2025
1 parent 2475d2c commit 834b0fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions src/components/FeedInterstitials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export function SuggestedFollowsProfile({did}: {did: string}) {
<ProfileGrid
isSuggestionsLoading={isSuggestionsLoading}
profiles={data?.suggestions ?? []}
recId={data?.recId}
error={error}
viewContext="profile"
/>
Expand All @@ -212,6 +213,7 @@ export function SuggestedFollowsHome() {
<ProfileGrid
isSuggestionsLoading={isSuggestionsLoading}
profiles={profiles}
recId={data?.recId}

Check failure on line 216 in src/components/FeedInterstitials.tsx

View workflow job for this annotation

GitHub Actions / Run linters

Cannot find name 'data'.
error={error}
viewContext="feed"
/>
Expand All @@ -222,10 +224,12 @@ export function ProfileGrid({
isSuggestionsLoading,
error,
profiles,
recId,
viewContext = 'feed',
}: {
isSuggestionsLoading: boolean
profiles: AppBskyActorDefs.ProfileViewDetailed[]
recId?: number
error: Error | null
viewContext: 'profile' | 'feed'
}) {
Expand Down Expand Up @@ -260,7 +264,7 @@ export function ProfileGrid({
viewContext === 'feed'
? 'InterstitialDiscover'
: 'InterstitialProfile',
recId: 123,
recId,
position: index,
})
}}
Expand Down Expand Up @@ -297,7 +301,7 @@ export function ProfileGrid({
? 'InterstitialDiscover'
: 'InterstitialProfile',
location: 'Card',
recId: 123,
recId,
position: index,
})
}}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/statsig/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@ export type LogEvents = {
| 'InterstitialProfile'
| 'Profile'
location: 'Card' | 'Profile'
recId: number
recId?: number
position: number
}
'suggestedUser:press': {
logContext: 'Explore' | 'InterstitialDiscover' | 'InterstitialProfile'
recId: number
recId?: number
position: number
}
'suggestedUser:seen': {
logContext: 'Explore' | 'InterstitialDiscover' | 'InterstitialProfile'
recId: number
recId?: number
position: number
}
'profile:unfollow': {
Expand Down
2 changes: 1 addition & 1 deletion src/state/queries/suggested-follows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function useSuggestedFollowsByActorQuery({
const suggestions = res.data.isFallback
? []
: res.data.suggestions.filter(profile => !profile.viewer?.following)
return {suggestions}
return {suggestions, recId: res.data.recId}
},
enabled,
})
Expand Down
6 changes: 4 additions & 2 deletions src/view/screens/Search/Explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ type ExploreScreenItems =
type: 'profile'
key: string
profile: AppBskyActorDefs.ProfileView
recId?: number
}
| {
type: 'feed'
Expand Down Expand Up @@ -372,6 +373,7 @@ export function Explore() {
type: 'profile',
key: actor.did,
profile: actor,
recId: page.recId,
})
}
}
Expand Down Expand Up @@ -529,15 +531,15 @@ export function Explore() {
onPress={() => {
logEvent('suggestedUser:press', {
logContext: 'Explore',
recId: 123,
recId: item.recId,
position: index,
})
}}
onFollow={() => {
logEvent('suggestedUser:follow', {
logContext: 'Explore',
location: 'Card',
recId: 123,
recId: item.recId,
position: index,
})
}}
Expand Down

0 comments on commit 834b0fe

Please sign in to comment.