feat: add data-nosnippet attribute to Discover feed for SEO control
This commit is contained in:
@@ -6,7 +6,7 @@ import {useLingui} from '@lingui/react'
|
|||||||
import {type NavigationProp, useNavigation} from '@react-navigation/native'
|
import {type NavigationProp, useNavigation} from '@react-navigation/native'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {VIDEO_FEED_URIS} from '#/lib/constants'
|
import {DISCOVER_FEED_URI, VIDEO_FEED_URIS} from '#/lib/constants'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {ComposeIcon2} from '#/lib/icons'
|
import {ComposeIcon2} from '#/lib/icons'
|
||||||
import {getRootNavigation, getTabState, TabState} from '#/lib/routes/helpers'
|
import {getRootNavigation, getTabState, TabState} from '#/lib/routes/helpers'
|
||||||
@@ -73,6 +73,10 @@ export function FeedPage({
|
|||||||
return isNative && _isVideoFeed
|
return isNative && _isVideoFeed
|
||||||
}, [feedInfo])
|
}, [feedInfo])
|
||||||
|
|
||||||
|
const isDiscoverFeed = useMemo(() => {
|
||||||
|
return feedInfo.uri === DISCOVER_FEED_URI
|
||||||
|
}, [feedInfo.uri])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isPageFocused) {
|
if (isPageFocused) {
|
||||||
setHomeBadge(hasNew)
|
setHomeBadge(hasNew)
|
||||||
@@ -128,7 +132,7 @@ export function FeedPage({
|
|||||||
|
|
||||||
const shouldPrefetch = isNative && isPageAdjacent
|
const shouldPrefetch = isNative && isPageAdjacent
|
||||||
return (
|
return (
|
||||||
<View testID={testID}>
|
<View testID={testID} {...(isDiscoverFeed && {'data-nosnippet': true})}>
|
||||||
<MainScrollProvider>
|
<MainScrollProvider>
|
||||||
<FeedFeedbackProvider value={feedFeedback}>
|
<FeedFeedbackProvider value={feedFeedback}>
|
||||||
<PostFeed
|
<PostFeed
|
||||||
|
|||||||
Reference in New Issue
Block a user