about summary refs log tree commit diff
path: root/src/view/com/composer/text-input/TextInput.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-10-10 15:44:27 -0500
committerGitHub <noreply@github.com>2023-10-10 13:44:27 -0700
commitfc28fc639fa20f8aceed2702d986ed239bb303e0 (patch)
treea6fbdc4cf5175800797550cce8451b0a1aaa5a2a /src/view/com/composer/text-input/TextInput.tsx
parentd68b4ca856098679efa50295b942833f3f8246cf (diff)
downloadvoidsky-fc28fc639fa20f8aceed2702d986ed239bb303e0.tar.zst
Don't highlight tags in composer yet (#1665)
Diffstat (limited to 'src/view/com/composer/text-input/TextInput.tsx')
-rw-r--r--src/view/com/composer/text-input/TextInput.tsx23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/view/com/composer/text-input/TextInput.tsx b/src/view/com/composer/text-input/TextInput.tsx
index c5d094ea5..2810129f6 100644
--- a/src/view/com/composer/text-input/TextInput.tsx
+++ b/src/view/com/composer/text-input/TextInput.tsx
@@ -187,16 +187,19 @@ export const TextInput = forwardRef(function TextInputImpl(
   const textDecorated = useMemo(() => {
     let i = 0
 
-    return Array.from(richtext.segments()).map(segment => (
-      <Text
-        key={i++}
-        style={[
-          !segment.facet ? pal.text : pal.link,
-          styles.textInputFormatting,
-        ]}>
-        {segment.text}
-      </Text>
-    ))
+    return Array.from(richtext.segments()).map(segment => {
+      const isTag = AppBskyRichtextFacet.isTag(segment.facet?.features?.[0])
+      return (
+        <Text
+          key={i++}
+          style={[
+            segment.facet && !isTag ? pal.link : pal.text,
+            styles.textInputFormatting,
+          ]}>
+          {segment.text}
+        </Text>
+      )
+    })
   }, [richtext, pal.link, pal.text])
 
   return (