Log rank and parent index with trending topic events (#11331)
This commit is contained in:
@@ -159,6 +159,7 @@ type FeedRow =
|
||||
| {
|
||||
type: 'interstitialFeedTrendingTopics'
|
||||
key: string
|
||||
feedSliceIndex: number
|
||||
}
|
||||
| {
|
||||
type: 'interstitialTrendingVideos'
|
||||
@@ -583,6 +584,7 @@ let PostFeed = ({
|
||||
arr.push({
|
||||
type: 'interstitialFeedTrendingTopics',
|
||||
key: 'interstitialFeedTrendingTopics-' + sliceIndex,
|
||||
feedSliceIndex: sliceIndex,
|
||||
})
|
||||
} else if (sliceIndex === trendingIndices.videos) {
|
||||
if (areVideoFeedsEnabled && !trendingVideoDisabled) {
|
||||
@@ -858,7 +860,9 @@ let PostFeed = ({
|
||||
} else if (row.type === 'interstitialTrending') {
|
||||
return <TrendingInterstitial />
|
||||
} else if (row.type === 'interstitialFeedTrendingTopics') {
|
||||
return <FeedTrendingTopicsInterstitial />
|
||||
return (
|
||||
<FeedTrendingTopicsInterstitial feedSliceIndex={row.feedSliceIndex} />
|
||||
)
|
||||
} else if (row.type === 'liveEventFeedsAndTrendingBanner') {
|
||||
return <DiscoverFeedLiveEventFeedsAndTrendingBanner />
|
||||
} else if (row.type === 'composerPrompt') {
|
||||
|
||||
@@ -119,44 +119,49 @@ function Inner() {
|
||||
))
|
||||
) : !trending?.trends ? null : (
|
||||
<>
|
||||
{trending.trends.slice(0, DEFAULT_LIMIT).map((topic, i) => (
|
||||
<TrendingTopicLink
|
||||
key={topic.link}
|
||||
topic={topic}
|
||||
metricContext="sidebar"
|
||||
recId={trending.recId}
|
||||
onPress={() => {
|
||||
ax.metric('trendingTopic:click', {
|
||||
context: 'sidebar',
|
||||
recId: trending.recId,
|
||||
})
|
||||
}}>
|
||||
{({hovered}) => (
|
||||
<View style={[a.flex_1, a.flex_row, a.gap_xs]}>
|
||||
<Text
|
||||
style={[
|
||||
a.text_sm,
|
||||
a.leading_snug,
|
||||
t.atoms.text_contrast_low,
|
||||
{minWidth: 16},
|
||||
]}>
|
||||
{i + 1}.
|
||||
</Text>
|
||||
<Text
|
||||
style={[
|
||||
a.flex_1,
|
||||
a.text_sm,
|
||||
a.leading_snug,
|
||||
hovered
|
||||
? [t.atoms.text, a.underline]
|
||||
: t.atoms.text_contrast_medium,
|
||||
]}>
|
||||
{topic.displayName ?? topic.topic}
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</TrendingTopicLink>
|
||||
))}
|
||||
{trending.trends.slice(0, DEFAULT_LIMIT).map((topic, i) => {
|
||||
const rank = i + 1
|
||||
return (
|
||||
<TrendingTopicLink
|
||||
key={topic.link}
|
||||
topic={topic}
|
||||
metricContext="sidebar"
|
||||
rank={rank}
|
||||
recId={trending.recId}
|
||||
onPress={() => {
|
||||
ax.metric('trendingTopic:click', {
|
||||
context: 'sidebar',
|
||||
rank,
|
||||
recId: trending.recId,
|
||||
})
|
||||
}}>
|
||||
{({hovered}) => (
|
||||
<View style={[a.flex_1, a.flex_row, a.gap_xs]}>
|
||||
<Text
|
||||
style={[
|
||||
a.text_sm,
|
||||
a.leading_snug,
|
||||
t.atoms.text_contrast_low,
|
||||
{minWidth: 16},
|
||||
]}>
|
||||
{rank}.
|
||||
</Text>
|
||||
<Text
|
||||
style={[
|
||||
a.flex_1,
|
||||
a.text_sm,
|
||||
a.leading_snug,
|
||||
hovered
|
||||
? [t.atoms.text, a.underline]
|
||||
: t.atoms.text_contrast_medium,
|
||||
]}>
|
||||
{topic.displayName ?? topic.topic}
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</TrendingTopicLink>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user