log event when following from starter pack list
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user