Pass correct log context to suggested user metrics (#10074)
(cherry picked from commit d44060a34e)
This commit is contained in:
@@ -480,10 +480,12 @@ export type Events = {
|
|||||||
'suggestedUser:follow': {
|
'suggestedUser:follow': {
|
||||||
logContext:
|
logContext:
|
||||||
| 'Explore'
|
| 'Explore'
|
||||||
| 'InterstitialDiscover'
|
| 'DiscoverInterstitial'
|
||||||
| 'InterstitialProfile'
|
| 'ProfileInterstitial'
|
||||||
| 'Profile'
|
| 'ProfileHeader'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
|
| 'SeeMoreSuggestedUsers'
|
||||||
|
| 'ProgressGuide'
|
||||||
location: 'Card' | 'Profile' | 'FollowAll'
|
location: 'Card' | 'Profile' | 'FollowAll'
|
||||||
recId?: number | string
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
@@ -493,9 +495,11 @@ export type Events = {
|
|||||||
'suggestedUser:press': {
|
'suggestedUser:press': {
|
||||||
logContext:
|
logContext:
|
||||||
| 'Explore'
|
| 'Explore'
|
||||||
| 'InterstitialDiscover'
|
| 'DiscoverInterstitial'
|
||||||
| 'InterstitialProfile'
|
| 'ProfileInterstitial'
|
||||||
|
| 'ProfileHeader'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
|
| 'SeeMoreSuggestedUsers'
|
||||||
recId?: number | string
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
suggestedDid: string
|
suggestedDid: string
|
||||||
@@ -504,10 +508,11 @@ export type Events = {
|
|||||||
'suggestedUser:seen': {
|
'suggestedUser:seen': {
|
||||||
logContext:
|
logContext:
|
||||||
| 'Explore'
|
| 'Explore'
|
||||||
| 'InterstitialDiscover'
|
| 'DiscoverInterstitial'
|
||||||
| 'InterstitialProfile'
|
| 'ProfileInterstitial'
|
||||||
| 'Profile'
|
| 'ProfileHeader'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
|
| 'SeeMoreSuggestedUsers'
|
||||||
| 'ProgressGuide'
|
| 'ProgressGuide'
|
||||||
recId?: number | string
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
@@ -517,14 +522,14 @@ export type Events = {
|
|||||||
'suggestedUser:seeMore': {
|
'suggestedUser:seeMore': {
|
||||||
logContext:
|
logContext:
|
||||||
| 'Explore'
|
| 'Explore'
|
||||||
| 'InterstitialDiscover'
|
| 'DiscoverInterstitial'
|
||||||
| 'InterstitialProfile'
|
| 'ProfileInterstitial'
|
||||||
| 'Profile'
|
| 'ProfileHeader'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
recId?: number | string
|
recId?: number | string
|
||||||
}
|
}
|
||||||
'suggestedUser:dismiss': {
|
'suggestedUser:dismiss': {
|
||||||
logContext: 'InterstitialDiscover' | 'InterstitialProfile'
|
logContext: 'DiscoverInterstitial' | 'ProfileInterstitial' | 'ProfileHeader'
|
||||||
recId?: number | string
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
suggestedDid: string
|
suggestedDid: string
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ import Animated, {
|
|||||||
LinearTransition,
|
LinearTransition,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {type AppBskyFeedDefs, AtUri} from '@atproto/api'
|
import {type AppBskyFeedDefs, AtUri} from '@atproto/api'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
import {type NavigationProp} from '#/lib/routes/types'
|
import {type NavigationProp} from '#/lib/routes/types'
|
||||||
@@ -295,7 +293,7 @@ export function ProfileGrid({
|
|||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
const followDialogControl = useDialogControl()
|
const followDialogControl = useDialogControl()
|
||||||
@@ -312,10 +310,10 @@ export function ProfileGrid({
|
|||||||
const containerRef = useRef<View>(null)
|
const containerRef = useRef<View>(null)
|
||||||
const hasTrackedRef = useRef(false)
|
const hasTrackedRef = useRef(false)
|
||||||
const logContext: Metrics['suggestedUser:seen']['logContext'] = isFeedContext
|
const logContext: Metrics['suggestedUser:seen']['logContext'] = isFeedContext
|
||||||
? 'InterstitialDiscover'
|
? 'DiscoverInterstitial'
|
||||||
: isProfileHeaderContext
|
: isProfileHeaderContext
|
||||||
? 'Profile'
|
? 'ProfileHeader'
|
||||||
: 'InterstitialProfile'
|
: 'ProfileInterstitial'
|
||||||
|
|
||||||
// Callback to fire seen events
|
// Callback to fire seen events
|
||||||
const fireSeen = useCallback(() => {
|
const fireSeen = useCallback(() => {
|
||||||
@@ -336,7 +334,7 @@ export function ProfileGrid({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, [ax, isLoading, error, profiles, maxLength, logContext])
|
}, [isLoading, error, profiles, maxLength, ax, logContext])
|
||||||
|
|
||||||
// For profile header, fire when isVisible becomes true
|
// For profile header, fire when isVisible becomes true
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -424,9 +422,7 @@ export function ProfileGrid({
|
|||||||
profile={profile.actor}
|
profile={profile.actor}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
ax.metric('suggestedUser:press', {
|
ax.metric('suggestedUser:press', {
|
||||||
logContext: isFeedContext
|
logContext,
|
||||||
? 'InterstitialDiscover'
|
|
||||||
: 'InterstitialProfile',
|
|
||||||
recId: profile.recId,
|
recId: profile.recId,
|
||||||
position: index,
|
position: index,
|
||||||
suggestedDid: profile.actor.did,
|
suggestedDid: profile.actor.did,
|
||||||
@@ -442,14 +438,12 @@ export function ProfileGrid({
|
|||||||
<ProfileCard.Outer>
|
<ProfileCard.Outer>
|
||||||
{onDismiss && (
|
{onDismiss && (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Dismiss this suggestion`)}
|
label={l`Dismiss this suggestion`}
|
||||||
onPress={e => {
|
onPress={e => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
onDismiss(profile.actor.did)
|
onDismiss(profile.actor.did)
|
||||||
ax.metric('suggestedUser:dismiss', {
|
ax.metric('suggestedUser:dismiss', {
|
||||||
logContext: isFeedContext
|
logContext,
|
||||||
? 'InterstitialDiscover'
|
|
||||||
: 'InterstitialProfile',
|
|
||||||
position: index,
|
position: index,
|
||||||
suggestedDid: profile.actor.did,
|
suggestedDid: profile.actor.did,
|
||||||
recId: profile.recId,
|
recId: profile.recId,
|
||||||
@@ -515,10 +509,8 @@ export function ProfileGrid({
|
|||||||
style={[a.rounded_sm]}
|
style={[a.rounded_sm]}
|
||||||
onFollow={() => {
|
onFollow={() => {
|
||||||
ax.metric('suggestedUser:follow', {
|
ax.metric('suggestedUser:follow', {
|
||||||
logContext: isFeedContext
|
logContext,
|
||||||
? 'InterstitialDiscover'
|
location: 'Profile',
|
||||||
: 'InterstitialProfile',
|
|
||||||
location: 'Card',
|
|
||||||
recId: profile.recId,
|
recId: profile.recId,
|
||||||
position: index,
|
position: index,
|
||||||
suggestedDid: profile.actor.did,
|
suggestedDid: profile.actor.did,
|
||||||
@@ -570,11 +562,11 @@ export function ProfileGrid({
|
|||||||
</Text>
|
</Text>
|
||||||
{!isProfileHeaderContext && (
|
{!isProfileHeaderContext && (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`See more suggested profiles`)}
|
label={l`See more suggested profiles`}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
followDialogControl.open()
|
followDialogControl.open()
|
||||||
ax.metric('suggestedUser:seeMore', {
|
ax.metric('suggestedUser:seeMore', {
|
||||||
logContext: isFeedContext ? 'Explore' : 'Profile',
|
logContext,
|
||||||
recId,
|
recId,
|
||||||
})
|
})
|
||||||
}}>
|
}}>
|
||||||
@@ -595,9 +587,7 @@ export function ProfileGrid({
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<FollowDialogWithoutGuide control={followDialogControl} />
|
<FollowDialogWithoutGuide control={followDialogControl} />
|
||||||
|
|
||||||
<LayoutAnimationConfig skipExiting skipEntering>
|
<LayoutAnimationConfig skipExiting skipEntering>
|
||||||
{gtMobile ? (
|
{gtMobile ? (
|
||||||
<View style={[a.p_lg, a.pt_md]}>
|
<View style={[a.p_lg, a.pt_md]}>
|
||||||
@@ -620,7 +610,7 @@ export function ProfileGrid({
|
|||||||
onPress={() => {
|
onPress={() => {
|
||||||
followDialogControl.open()
|
followDialogControl.open()
|
||||||
ax.metric('suggestedUser:seeMore', {
|
ax.metric('suggestedUser:seeMore', {
|
||||||
logContext: 'Explore',
|
logContext,
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -634,11 +624,11 @@ export function ProfileGrid({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SeeMoreSuggestedProfilesCard({onPress}: {onPress: () => void}) {
|
function SeeMoreSuggestedProfilesCard({onPress}: {onPress: () => void}) {
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Browse more accounts`)}
|
label={l`Browse more accounts`}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
style={[
|
style={[
|
||||||
a.flex_col,
|
a.flex_col,
|
||||||
@@ -662,7 +652,7 @@ const numFeedsToDisplay = 3
|
|||||||
export function SuggestedFeeds() {
|
export function SuggestedFeeds() {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const {data, isLoading, error} = useGetPopularFeedsQuery({
|
const {data, isLoading, error} = useGetPopularFeedsQuery({
|
||||||
limit: numFeedsToDisplay,
|
limit: numFeedsToDisplay,
|
||||||
})
|
})
|
||||||
@@ -749,7 +739,7 @@ export function SuggestedFeeds() {
|
|||||||
a.gap_md,
|
a.gap_md,
|
||||||
]}>
|
]}>
|
||||||
<InlineLinkText
|
<InlineLinkText
|
||||||
label={_(msg`Browse more suggestions`)}
|
label={l`Browse more suggestions`}
|
||||||
to="/search"
|
to="/search"
|
||||||
style={[t.atoms.text_contrast_medium]}>
|
style={[t.atoms.text_contrast_medium]}>
|
||||||
<Trans>Browse more suggestions</Trans>
|
<Trans>Browse more suggestions</Trans>
|
||||||
@@ -768,7 +758,7 @@ export function SuggestedFeeds() {
|
|||||||
{content}
|
{content}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Browse more feeds on the Explore page`)}
|
label={l`Browse more feeds on the Explore page`}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigation.navigate('SearchTab')
|
navigation.navigate('SearchTab')
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import {memo, useCallback, useEffect, useMemo, useRef, useState} from 'react'
|
import {memo, useCallback, useEffect, useMemo, useRef, useState} from 'react'
|
||||||
import {TextInput, View, type ViewToken} from 'react-native'
|
import {TextInput, View, type ViewToken} from 'react-native'
|
||||||
import {type ModerationOpts} from '@atproto/api'
|
import {type ModerationOpts} from '@atproto/api'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
|
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
||||||
@@ -64,14 +62,14 @@ export function FollowDialog({
|
|||||||
showArrow?: boolean
|
showArrow?: boolean
|
||||||
}) {
|
}) {
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const control = Dialog.useDialogControl()
|
const control = Dialog.useDialogControl()
|
||||||
const {gtPhone} = useBreakpoints()
|
const {gtPhone} = useBreakpoints()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Find people to follow`)}
|
label={l`Find people to follow`}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
control.open()
|
control.open()
|
||||||
ax.metric('progressGuide:followDialog:open', {})
|
ax.metric('progressGuide:followDialog:open', {})
|
||||||
@@ -112,7 +110,7 @@ let lastSelectedInterest = ''
|
|||||||
let lastSearchText = ''
|
let lastSearchText = ''
|
||||||
|
|
||||||
function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const interestsDisplayNames = useInterestsDisplayNames()
|
const interestsDisplayNames = useInterestsDisplayNames()
|
||||||
const {data: preferences} = usePreferencesQuery()
|
const {data: preferences} = usePreferencesQuery()
|
||||||
@@ -182,7 +180,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
_items.push({
|
_items.push({
|
||||||
type: 'empty',
|
type: 'empty',
|
||||||
key: 'empty',
|
key: 'empty',
|
||||||
message: _(msg`We're having network issues, try again`),
|
message: l`We're having network issues, try again`,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const seen = new Set<string>()
|
const seen = new Set<string>()
|
||||||
@@ -208,12 +206,12 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
!_items.length &&
|
!_items.length &&
|
||||||
!isSearchResultsError
|
!isSearchResultsError
|
||||||
) {
|
) {
|
||||||
_items.push({type: 'empty', key: 'empty', message: _(msg`No results`)})
|
_items.push({type: 'empty', key: 'empty', message: l`No results`})
|
||||||
}
|
}
|
||||||
|
|
||||||
return _items
|
return _items
|
||||||
}, [
|
}, [
|
||||||
_,
|
l,
|
||||||
suggestions,
|
suggestions,
|
||||||
suggestionsError,
|
suggestionsError,
|
||||||
isFetchingSuggestions,
|
isFetchingSuggestions,
|
||||||
@@ -226,6 +224,9 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
isSearchResultsError,
|
isSearchResultsError,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const isGuide = Boolean(guide)
|
||||||
|
const recIdForLogging = hasSearchText ? undefined : suggestions?.recId
|
||||||
|
|
||||||
const renderItems = useCallback(
|
const renderItems = useCallback(
|
||||||
({item, index}: {item: Item; index: number}) => {
|
({item, index}: {item: Item; index: number}) => {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
@@ -235,6 +236,9 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
profile={item.profile}
|
profile={item.profile}
|
||||||
moderationOpts={moderationOpts!}
|
moderationOpts={moderationOpts!}
|
||||||
noBorder={index === 0}
|
noBorder={index === 0}
|
||||||
|
position={index}
|
||||||
|
recId={recIdForLogging}
|
||||||
|
isGuide={isGuide}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -248,7 +252,7 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[moderationOpts],
|
[moderationOpts, recIdForLogging, isGuide],
|
||||||
)
|
)
|
||||||
|
|
||||||
// Track seen profiles
|
// Track seen profiles
|
||||||
@@ -269,8 +273,8 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
i => i.type === 'profile' && i.profile.did === item.profile.did,
|
i => i.type === 'profile' && i.profile.did === item.profile.did,
|
||||||
)
|
)
|
||||||
ax.metric('suggestedUser:seen', {
|
ax.metric('suggestedUser:seen', {
|
||||||
logContext: 'ProgressGuide',
|
logContext: isGuide ? 'ProgressGuide' : 'SeeMoreSuggestedUsers',
|
||||||
recId: hasSearchText ? undefined : suggestions?.recId,
|
recId: recIdForLogging,
|
||||||
position: position !== -1 ? position : 0,
|
position: position !== -1 ? position : 0,
|
||||||
suggestedDid: item.profile.did,
|
suggestedDid: item.profile.did,
|
||||||
category: selectedInterestRef.current,
|
category: selectedInterestRef.current,
|
||||||
@@ -404,7 +408,7 @@ let Header = ({
|
|||||||
Header = memo(Header)
|
Header = memo(Header)
|
||||||
|
|
||||||
function HeaderTop({guide}: {guide?: Follow10ProgressGuide}) {
|
function HeaderTop({guide}: {guide?: Follow10ProgressGuide}) {
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const control = Dialog.useDialogContext()
|
const control = Dialog.useDialogContext()
|
||||||
return (
|
return (
|
||||||
@@ -438,7 +442,7 @@ function HeaderTop({guide}: {guide?: Follow10ProgressGuide}) {
|
|||||||
)}
|
)}
|
||||||
{IS_WEB ? (
|
{IS_WEB ? (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Close`)}
|
label={l`Close`}
|
||||||
size="small"
|
size="small"
|
||||||
shape="round"
|
shape="round"
|
||||||
variant={IS_WEB ? 'ghost' : 'solid'}
|
variant={IS_WEB ? 'ghost' : 'solid'}
|
||||||
@@ -474,22 +478,18 @@ let Tab = ({
|
|||||||
onLayout: (index: number, x: number, width: number) => void
|
onLayout: (index: number, x: number, width: number) => void
|
||||||
}): React.ReactNode => {
|
}): React.ReactNode => {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const label = active
|
const label = active
|
||||||
? _(
|
? l({
|
||||||
msg({
|
message: `Search for "${interestsDisplayName}" (active)`,
|
||||||
message: `Search for "${interestsDisplayName}" (active)`,
|
comment:
|
||||||
comment:
|
'Accessibility label for a tab that searches for accounts in a category (e.g. Art, Video Games, Sports, etc.) that are suggested for the user to follow. The tab is currently selected.',
|
||||||
'Accessibility label for a tab that searches for accounts in a category (e.g. Art, Video Games, Sports, etc.) that are suggested for the user to follow. The tab is currently selected.',
|
})
|
||||||
}),
|
: l({
|
||||||
)
|
message: `Search for "${interestsDisplayName}"`,
|
||||||
: _(
|
comment:
|
||||||
msg({
|
'Accessibility label for a tab that searches for accounts in a category (e.g. Art, Video Games, Sports, etc.) that are suggested for the user to follow. The tab is not currently active and can be selected.',
|
||||||
message: `Search for "${interestsDisplayName}"`,
|
})
|
||||||
comment:
|
|
||||||
'Accessibility label for a tab that searches for accounts in a category (e.g. Art, Video Games, Sports, etc.) that are suggested for the user to follow. The tab is not currently active and can be selected.',
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
key={interest}
|
key={interest}
|
||||||
@@ -532,16 +532,25 @@ let FollowProfileCard = ({
|
|||||||
profile,
|
profile,
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
noBorder,
|
noBorder,
|
||||||
|
position,
|
||||||
|
recId,
|
||||||
|
isGuide,
|
||||||
}: {
|
}: {
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
noBorder?: boolean
|
noBorder?: boolean
|
||||||
|
position: number
|
||||||
|
recId?: string
|
||||||
|
isGuide: boolean
|
||||||
}): React.ReactNode => {
|
}): React.ReactNode => {
|
||||||
return (
|
return (
|
||||||
<FollowProfileCardInner
|
<FollowProfileCardInner
|
||||||
profile={profile}
|
profile={profile}
|
||||||
moderationOpts={moderationOpts}
|
moderationOpts={moderationOpts}
|
||||||
noBorder={noBorder}
|
noBorder={noBorder}
|
||||||
|
position={position}
|
||||||
|
recId={recId}
|
||||||
|
isGuide={isGuide}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -552,14 +561,21 @@ function FollowProfileCardInner({
|
|||||||
moderationOpts,
|
moderationOpts,
|
||||||
onFollow,
|
onFollow,
|
||||||
noBorder,
|
noBorder,
|
||||||
|
position,
|
||||||
|
recId,
|
||||||
|
isGuide,
|
||||||
}: {
|
}: {
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
onFollow?: () => void
|
onFollow?: () => void
|
||||||
noBorder?: boolean
|
noBorder?: boolean
|
||||||
|
position: number
|
||||||
|
recId?: string
|
||||||
|
isGuide: boolean
|
||||||
}) {
|
}) {
|
||||||
const control = Dialog.useDialogContext()
|
const control = Dialog.useDialogContext()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
const ax = useAnalytics()
|
||||||
return (
|
return (
|
||||||
<ProfileCard.Link
|
<ProfileCard.Link
|
||||||
profile={profile}
|
profile={profile}
|
||||||
@@ -588,7 +604,19 @@ function FollowProfileCardInner({
|
|||||||
moderationOpts={moderationOpts}
|
moderationOpts={moderationOpts}
|
||||||
logContext="PostOnboardingFindFollows"
|
logContext="PostOnboardingFindFollows"
|
||||||
shape="round"
|
shape="round"
|
||||||
onPress={onFollow}
|
onPress={() => {
|
||||||
|
ax.metric('suggestedUser:follow', {
|
||||||
|
logContext: isGuide
|
||||||
|
? 'ProgressGuide'
|
||||||
|
: 'SeeMoreSuggestedUsers',
|
||||||
|
location: 'Card',
|
||||||
|
recId,
|
||||||
|
position,
|
||||||
|
suggestedDid: profile.did,
|
||||||
|
category: null,
|
||||||
|
})
|
||||||
|
onFollow?.()
|
||||||
|
}}
|
||||||
colorInverted
|
colorInverted
|
||||||
/>
|
/>
|
||||||
</ProfileCard.Header>
|
</ProfileCard.Header>
|
||||||
@@ -632,7 +660,7 @@ function SearchInput({
|
|||||||
defaultValue: string
|
defaultValue: string
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const {
|
const {
|
||||||
state: hovered,
|
state: hovered,
|
||||||
onIn: onMouseEnter,
|
onIn: onMouseEnter,
|
||||||
@@ -652,10 +680,9 @@ function SearchInput({
|
|||||||
size="md"
|
size="md"
|
||||||
fill={interacted ? t.palette.primary_500 : t.palette.contrast_300}
|
fill={interacted ? t.palette.primary_500 : t.palette.contrast_300}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
placeholder={_(msg`Search by name or interest`)}
|
placeholder={l`Search by name or interest`}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
onChangeText={onChangeText}
|
onChangeText={onChangeText}
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
@@ -674,8 +701,8 @@ function SearchInput({
|
|||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
accessibilityLabel={_(msg`Search profiles`)}
|
accessibilityLabel={l`Search profiles`}
|
||||||
accessibilityHint={_(msg`Searches for profiles`)}
|
accessibilityHint={l`Searches for profiles`}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user