Don't highlight tags in composer yet (#1665)

zio/stable
Eric Bailey 2023-10-10 15:44:27 -05:00 committed by GitHub
parent d68b4ca856
commit fc28fc639f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 10 deletions

View File

@ -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 (