log event when following from starter pack list

This commit is contained in:
Hailey
2024-06-10 13:16:47 -07:00
parent b4566fed97
commit f938fb8bd5
4 changed files with 17 additions and 7 deletions
+2
View File
@@ -125,6 +125,7 @@ export type LogEvents = {
| 'ProfileMenu'
| 'ProfileHoverCard'
| 'AvatarButton'
| 'StarterPackProfilesList'
}
'profile:unfollow': {
logContext:
@@ -137,6 +138,7 @@ export type LogEvents = {
| 'ProfileHoverCard'
| 'Chat'
| 'AvatarButton'
| 'StarterPackProfilesList'
}
'chat:create': {
logContext: 'ProfileHeader' | 'NewChatDialog' | 'SendViaChatDialog'
@@ -10,7 +10,12 @@ import {List, ListRef} from 'view/com/util/List'
import {SectionRef} from '#/screens/Profile/Sections/types'
function renderItem({item}: {item: AppBskyActorDefs.ProfileViewBasic}) {
return <ProfileCardWithFollowBtn profile={item} />
return (
<ProfileCardWithFollowBtn
profile={item}
logContext="StarterPackProfilesList"
/>
)
}
function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic, index: number) {
+6 -5
View File
@@ -1,12 +1,13 @@
import React from 'react'
import {StyleProp, TextStyle, View} from 'react-native'
import {AppBskyActorDefs} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {Shadow} from '#/state/cache/types'
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
import {Button, ButtonType} from '../util/forms/Button'
import * as Toast from '../util/Toast'
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
import {Shadow} from '#/state/cache/types'
import {useLingui} from '@lingui/react'
import {msg} from '@lingui/macro'
export function FollowButton({
unfollowedType = 'inverted',
@@ -19,7 +20,7 @@ export function FollowButton({
followedType?: ButtonType
profile: Shadow<AppBskyActorDefs.ProfileViewBasic>
labelStyle?: StyleProp<TextStyle>
logContext: 'ProfileCard'
logContext: 'ProfileCard' | 'StarterPackProfilesList'
}) {
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(
profile,
+3 -1
View File
@@ -251,12 +251,14 @@ export function ProfileCardWithFollowBtn({
noBorder,
followers,
onPress,
logContext = 'ProfileCard',
}: {
profile: AppBskyActorDefs.ProfileViewBasic
noBg?: boolean
noBorder?: boolean
followers?: AppBskyActorDefs.ProfileView[] | undefined
onPress?: () => void
logContext?: 'ProfileCard' | 'StarterPackProfilesList'
}) {
const {currentAccount} = useSession()
const isMe = profile.did === currentAccount?.did
@@ -271,7 +273,7 @@ export function ProfileCardWithFollowBtn({
isMe
? undefined
: profileShadow => (
<FollowButton profile={profileShadow} logContext="ProfileCard" />
<FollowButton profile={profileShadow} logContext={logContext} />
)
}
onPress={onPress}