env var tweaks (#7457)

* add new events

* Discard changes to package.json

* Discard changes to src/lib/constants.ts

* Discard changes to src/state/feed-feedback.tsx

* Discard changes to yarn.lock

* remove unused event
This commit is contained in:
Hailey
2025-01-26 15:40:02 -08:00
committed by GitHub
parent 355c50fc0f
commit ebb6d5cc0f
7 changed files with 76 additions and 6 deletions
+3
View File
@@ -14,12 +14,14 @@ export function FollowButton({
profile,
labelStyle,
logContext,
onFollow,
}: {
unfollowedType?: ButtonType
followedType?: ButtonType
profile: Shadow<AppBskyActorDefs.ProfileViewBasic>
labelStyle?: StyleProp<TextStyle>
logContext: 'ProfileCard' | 'StarterPackProfilesList'
onFollow?: () => void
}) {
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(
profile,
@@ -30,6 +32,7 @@ export function FollowButton({
const onPressFollow = async () => {
try {
await queueFollow()
onFollow?.()
} catch (e: any) {
if (e?.name !== 'AbortError') {
Toast.show(_(msg`An issue occurred, please try again.`), 'xmark')
+7 -1
View File
@@ -184,6 +184,7 @@ export function ProfileCardWithFollowBtn({
noBg,
noBorder,
onPress,
onFollow,
logContext = 'ProfileCard',
showKnownFollowers,
}: {
@@ -191,6 +192,7 @@ export function ProfileCardWithFollowBtn({
noBg?: boolean
noBorder?: boolean
onPress?: () => void
onFollow?: () => void
logContext?: 'ProfileCard' | 'StarterPackProfilesList'
showKnownFollowers?: boolean
}) {
@@ -206,7 +208,11 @@ export function ProfileCardWithFollowBtn({
isMe
? undefined
: profileShadow => (
<FollowButton profile={profileShadow} logContext={logContext} />
<FollowButton
profile={profileShadow}
logContext={logContext}
onFollow={onFollow}
/>
)
}
onPress={onPress}
+19 -1
View File
@@ -10,6 +10,7 @@ import {
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {logEvent} from '#/lib/statsig/statsig'
import {cleanError} from '#/lib/strings/errors'
import {logger} from '#/logger'
import {isNative, isWeb} from '#/platform/detection'
@@ -259,6 +260,7 @@ type ExploreScreenItems =
type: 'profile'
key: string
profile: AppBskyActorDefs.ProfileView
recId?: number
}
| {
type: 'feed'
@@ -383,6 +385,7 @@ export function Explore() {
type: 'profile',
key: actor.did,
profile: actor,
recId: page.recId,
})
}
}
@@ -511,7 +514,7 @@ export function Explore() {
])
const renderItem = React.useCallback(
({item}: {item: ExploreScreenItems}) => {
({item, index}: {item: ExploreScreenItems; index: number}) => {
switch (item.type) {
case 'header': {
return (
@@ -540,6 +543,21 @@ export function Explore() {
noBg
noBorder
showKnownFollowers
onPress={() => {
logEvent('suggestedUser:press', {
logContext: 'Explore',
recId: item.recId,
position: index,
})
}}
onFollow={() => {
logEvent('suggestedUser:follow', {
logContext: 'Explore',
location: 'Card',
recId: item.recId,
position: index,
})
}}
/>
</View>
)