From 95720f7744090f7d5165ce1a8ee190bf3071eb00 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 13 Nov 2024 13:29:26 -0600 Subject: [PATCH] Fix types --- src/components/Link.tsx | 9 +++++---- src/components/RichText.tsx | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 335ea0bced..1720e430da 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -236,12 +236,12 @@ export function Link({ ) } -export type InlineLinkProps = React.PropsWithChildren< - BaseLinkProps & TextStyleProp & Pick -> & +export type InlineLinkProps = BaseLinkProps & + TextStyleProp & + Pick & Pick & { disableUnderline?: boolean - title?: TextProps['title'] + children: React.ReactNode } export function InlineLinkText({ @@ -355,6 +355,7 @@ export function WebOnlyInlineLinkText({ {children} ) : ( + // @ts-expect-error can't determine type of `children` to infer `emoji` {children} ) } diff --git a/src/components/RichText.tsx b/src/components/RichText.tsx index 8f6358dd5a..9054ffb8e1 100644 --- a/src/components/RichText.tsx +++ b/src/components/RichText.tsx @@ -105,6 +105,7 @@ export function RichText({ els.push( , ) } 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( - {toShortUrl(segment.text)} + {url} , ) }