diff options
author | Eric Bailey <git@esb.lol> | 2024-04-13 00:13:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-13 06:13:53 +0100 |
commit | f5bb348bf51df6f6d35eb23cdf771c184d77fec4 (patch) | |
tree | c23990e4f1d3cb1d4dd06433a31423f265fd1ac6 /src/components/RichText.tsx | |
parent | a845587e1f0b74b087b0c59d1cdc8e6c5feaf98f (diff) | |
download | voidsky-f5bb348bf51df6f6d35eb23cdf771c184d77fec4.tar.zst |
Profile hovers (#3518)
* Add hover card for mentions * Reposted by * Fix key * Add to composer reply to
Diffstat (limited to 'src/components/RichText.tsx')
-rw-r--r-- | src/components/RichText.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/components/RichText.tsx b/src/components/RichText.tsx index 17f36c141..82cdda107 100644 --- a/src/components/RichText.tsx +++ b/src/components/RichText.tsx @@ -8,6 +8,7 @@ import {isNative} from '#/platform/detection' import {atoms as a, flatten, native, TextStyleProp, useTheme, web} from '#/alf' import {useInteractionState} from '#/components/hooks/useInteractionState' import {InlineLinkText, LinkProps} from '#/components/Link' +import {ProfileHoverCard} from '#/components/ProfileHoverCard' import {TagMenu, useTagMenuControl} from '#/components/TagMenu' import {Text, TextProps} from '#/components/Typography' @@ -86,16 +87,17 @@ export function RichText({ !disableLinks ) { els.push( - <InlineLinkText - selectable={selectable} - key={key} - to={`/profile/${mention.did}`} - style={[...styles, {pointerEvents: 'auto'}]} - // @ts-ignore TODO - dataSet={WORD_WRAP} - onPress={onLinkPress}> - {segment.text} - </InlineLinkText>, + <ProfileHoverCard key={key} inline did={mention.did}> + <InlineLinkText + selectable={selectable} + to={`/profile/${mention.did}`} + style={[...styles, {pointerEvents: 'auto'}]} + // @ts-ignore TODO + dataSet={WORD_WRAP} + onPress={onLinkPress}> + {segment.text} + </InlineLinkText> + </ProfileHoverCard>, ) } else if (link && AppBskyRichtextFacet.validateLink(link).success) { if (disableLinks) { |