diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-18 13:59:17 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-18 13:59:17 -0600 |
commit | 6e2b7a0b90ae8140d81d2d66c87ec9e40d9f45ec (patch) | |
tree | f36f902da70006364e839ee53d55a468c7539e21 /src/view/com/util/RichText.tsx | |
parent | 9d13e05dbf0bb6430060ddf556006b1721444edc (diff) | |
download | voidsky-6e2b7a0b90ae8140d81d2d66c87ec9e40d9f45ec.tar.zst |
Add support for web links
Diffstat (limited to 'src/view/com/util/RichText.tsx')
-rw-r--r-- | src/view/com/util/RichText.tsx | 27 |
1 files changed, 19 insertions, 8 deletions
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++ } |