Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Disable facets in `FeedCard.Description` component (#4620)

authored by

Eric Bailey and committed by
GitHub
6cda6412 615c0c85

+9 -8
+9 -8
src/components/FeedCard.tsx
··· 5 5 AppBskyFeedDefs, 6 6 AppBskyGraphDefs, 7 7 AtUri, 8 + RichText as RichTextApi, 8 9 } from '@atproto/api' 9 10 import {msg, plural, Trans} from '@lingui/macro' 10 11 import {useLingui} from '@lingui/react' ··· 24 25 import {useTheme} from '#/alf' 25 26 import {atoms as a} from '#/alf' 26 27 import {Button, ButtonIcon} from '#/components/Button' 27 - import {useRichText} from '#/components/hooks/useRichText' 28 28 import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus' 29 29 import {Trash_Stroke2_Corner0_Rounded as Trash} from '#/components/icons/Trash' 30 30 import {Link as InternalLink, LinkProps} from '#/components/Link' ··· 199 199 } 200 200 201 201 export function Description({description}: {description?: string}) { 202 - const [rt, isResolving] = useRichText(description || '') 203 - if (!description) return null 204 - return isResolving ? ( 205 - <RichText value={description} style={[a.leading_snug]} /> 206 - ) : ( 207 - <RichText value={rt} style={[a.leading_snug]} /> 208 - ) 202 + const rt = React.useMemo(() => { 203 + if (!description) return 204 + const rt = new RichTextApi({text: description || ''}) 205 + rt.detectFacetsWithoutResolution() 206 + return rt 207 + }, [description]) 208 + if (!rt) return null 209 + return <RichText value={rt} style={[a.leading_snug]} disableLinks /> 209 210 } 210 211 211 212 export function Likes({count}: {count: number}) {