about summary refs log tree commit diff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/FeedInterstitials.tsx25
-rw-r--r--src/components/ProfileCard.tsx3
2 files changed, 26 insertions, 2 deletions
diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx
index 268a5ff5b..926d27baa 100644
--- a/src/components/FeedInterstitials.tsx
+++ b/src/components/FeedInterstitials.tsx
@@ -196,6 +196,7 @@ export function SuggestedFollowsProfile({did}: {did: string}) {
     <ProfileGrid
       isSuggestionsLoading={isSuggestionsLoading}
       profiles={data?.suggestions ?? []}
+      recId={data?.recId}
       error={error}
       viewContext="profile"
     />
@@ -222,10 +223,12 @@ export function ProfileGrid({
   isSuggestionsLoading,
   error,
   profiles,
+  recId,
   viewContext = 'feed',
 }: {
   isSuggestionsLoading: boolean
   profiles: AppBskyActorDefs.ProfileViewDetailed[]
+  recId?: number
   error: Error | null
   viewContext: 'profile' | 'feed'
 }) {
@@ -249,12 +252,19 @@ export function ProfileGrid({
       ))
   ) : error || !profiles.length ? null : (
     <>
-      {profiles.slice(0, maxLength).map(profile => (
+      {profiles.slice(0, maxLength).map((profile, index) => (
         <ProfileCard.Link
           key={profile.did}
           profile={profile}
           onPress={() => {
-            logEvent('feed:interstitial:profileCard:press', {})
+            logEvent('suggestedUser:press', {
+              logContext:
+                viewContext === 'feed'
+                  ? 'InterstitialDiscover'
+                  : 'InterstitialProfile',
+              recId,
+              position: index,
+            })
           }}
           style={[
             a.flex_1,
@@ -282,6 +292,17 @@ export function ProfileGrid({
                     logContext="FeedInterstitial"
                     shape="round"
                     colorInverted
+                    onFollow={() => {
+                      logEvent('suggestedUser:follow', {
+                        logContext:
+                          viewContext === 'feed'
+                            ? 'InterstitialDiscover'
+                            : 'InterstitialProfile',
+                        location: 'Card',
+                        recId,
+                        position: index,
+                      })
+                    }}
                   />
                 </ProfileCard.Header>
                 <ProfileCard.Description profile={profile} numberOfLines={2} />
diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx
index 7bec14b9c..78d86ab36 100644
--- a/src/components/ProfileCard.tsx
+++ b/src/components/ProfileCard.tsx
@@ -286,6 +286,7 @@ export type FollowButtonProps = {
   logContext: LogEvents['profile:follow']['logContext'] &
     LogEvents['profile:unfollow']['logContext']
   colorInverted?: boolean
+  onFollow?: () => void
 } & Partial<ButtonProps>
 
 export function FollowButton(props: FollowButtonProps) {
@@ -299,6 +300,7 @@ export function FollowButtonInner({
   moderationOpts,
   logContext,
   onPress: onPressProp,
+  onFollow,
   colorInverted,
   ...rest
 }: FollowButtonProps) {
@@ -325,6 +327,7 @@ export function FollowButtonInner({
         ),
       )
       onPressProp?.(e)
+      onFollow?.()
     } catch (err: any) {
       if (err?.name !== 'AbortError') {
         Toast.show(_(msg`An issue occurred, please try again.`), 'xmark')