From 6e2b7a0b90ae8140d81d2d66c87ec9e40d9f45ec Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Fri, 18 Nov 2022 13:59:17 -0600
Subject: Add support for web links

---
 src/view/com/util/RichText.tsx | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

(limited to 'src/view/com/util/RichText.tsx')

diff --git a/src/view/com/util/RichText.tsx b/src/view/com/util/RichText.tsx
index 35948455a..f865c873a 100644
--- a/src/view/com/util/RichText.tsx
+++ b/src/view/com/util/RichText.tsx
@@ -32,14 +32,25 @@ export function RichText({
     if (typeof segment === 'string') {
       els.push(segment)
     } else {
-      els.push(
-        <TextLink
-          key={key}
-          text={segment.text}
-          href={`/profile/${segment.entity.value}`}
-          style={[style, s.blue3]}
-        />,
-      )
+      if (segment.entity.type === 'mention') {
+        els.push(
+          <TextLink
+            key={key}
+            text={segment.text}
+            href={`/profile/${segment.entity.value}`}
+            style={[style, s.blue3]}
+          />,
+        )
+      } else if (segment.entity.type === 'link') {
+        els.push(
+          <TextLink
+            key={key}
+            text={segment.text}
+            href={segment.entity.value}
+            style={[style, s.blue3]}
+          />,
+        )
+      }
     }
     key++
   }
-- 
cgit 1.4.1

