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
+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}