Fix types
This commit is contained in:
@@ -236,12 +236,12 @@ export function Link({
|
||||
)
|
||||
}
|
||||
|
||||
export type InlineLinkProps = React.PropsWithChildren<
|
||||
BaseLinkProps & TextStyleProp & Pick<TextProps, 'selectable' | 'dataSet'>
|
||||
> &
|
||||
export type InlineLinkProps = BaseLinkProps &
|
||||
TextStyleProp &
|
||||
Pick<TextProps, 'selectable' | 'dataSet' | 'title' | 'emoji'> &
|
||||
Pick<ButtonProps, 'label'> & {
|
||||
disableUnderline?: boolean
|
||||
title?: TextProps['title']
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
export function InlineLinkText({
|
||||
@@ -355,6 +355,7 @@ export function WebOnlyInlineLinkText({
|
||||
{children}
|
||||
</InlineLinkText>
|
||||
) : (
|
||||
// @ts-expect-error can't determine type of `children` to infer `emoji`
|
||||
<Text {...props}>{children}</Text>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ export function RichText({
|
||||
els.push(
|
||||
<ProfileHoverCard key={key} inline did={mention.did}>
|
||||
<InlineLinkText
|
||||
label={segment.text}
|
||||
selectable={selectable}
|
||||
to={`/profile/${mention.did}`}
|
||||
style={interactiveStyles}
|
||||
@@ -116,11 +117,13 @@ export function RichText({
|
||||
</ProfileHoverCard>,
|
||||
)
|
||||
} else if (link && AppBskyRichtextFacet.validateLink(link).success) {
|
||||
const url = toShortUrl(segment.text)
|
||||
if (disableLinks) {
|
||||
els.push(toShortUrl(segment.text))
|
||||
els.push(url)
|
||||
} else {
|
||||
els.push(
|
||||
<InlineLinkText
|
||||
label={url}
|
||||
selectable={selectable}
|
||||
key={key}
|
||||
to={link.uri}
|
||||
@@ -130,7 +133,7 @@ export function RichText({
|
||||
shareOnLongPress
|
||||
onPress={onLinkPress}
|
||||
emoji>
|
||||
{toShortUrl(segment.text)}
|
||||
{url}
|
||||
</InlineLinkText>,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user