about summary refs log tree commit diff
path: root/src/view/com/util/NoSnippetWrapper.tsx
diff options
context:
space:
mode:
authorCaidan Williams <caidan@internet.dev>2025-08-26 14:07:18 -0700
committerCaidan Williams <caidan@internet.dev>2025-08-27 11:58:58 -0700
commitbd730db03ecf90efc66953f222d5a7a43cdefe2f (patch)
treeee9f8f94a61e70a3d8036d8dc6c45e207885221a /src/view/com/util/NoSnippetWrapper.tsx
parent6ddc268b91d990da6ef754323310227690378556 (diff)
downloadvoidsky-bd730db03ecf90efc66953f222d5a7a43cdefe2f.tar.zst
refactor(feed): remove NoSnippetWrapper from FeedPage in favor of dataSet attribute
Replaces NoSnippetWrapper with a dataSet prop on the root View to
control the nosnippet attribute for discover feeds. This simplifies the
component structure and improves maintainability by reducing unnecessary
wrappers.
Diffstat (limited to 'src/view/com/util/NoSnippetWrapper.tsx')
-rw-r--r--src/view/com/util/NoSnippetWrapper.tsx29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/view/com/util/NoSnippetWrapper.tsx b/src/view/com/util/NoSnippetWrapper.tsx
deleted file mode 100644
index fcf658249..000000000
--- a/src/view/com/util/NoSnippetWrapper.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import {type ViewProps} from 'react-native'
-// @ts-expect-error untyped
-import {unstable_createElement} from 'react-native-web'
-
-import {isWeb} from '#/platform/detection'
-
-interface Props extends ViewProps {
-  enabled: boolean
-}
-
-/**
- * NoSnippetWrapper prevents search engines from displaying snippets of its content.
- *
- * If running on web and enabled, wraps children in a <div> with data-nosnippet attribute.
- * Otherwise, renders children directly.
- *
- * @param enabled - Whether to apply the data-nosnippet attribute.
- * @param viewProps - Additional props for the wrapper element.
- */
-export function NoSnippetWrapper({enabled, ...viewProps}: Props) {
-  if (isWeb && enabled) {
-    return unstable_createElement('div', {
-      ...viewProps,
-      'data-nosnippet': '',
-    })
-  }
-
-  return <>{viewProps.children}</>
-}