fix link item embed regression
This commit is contained in:
parent
80a7c24e54
commit
4f158a98a8
@ -19,12 +19,13 @@ import Share from './share'
|
|||||||
import Toc from './table-of-contents'
|
import Toc from './table-of-contents'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { RootProvider } from './root'
|
import { RootProvider } from './root'
|
||||||
import { decodeProxyUrl, IMGPROXY_URL_REGEXP } from '@/lib/url'
|
import { decodeProxyUrl, IMGPROXY_URL_REGEXP, parseEmbedUrl } from '@/lib/url'
|
||||||
import { numWithUnits } from '@/lib/format'
|
import { numWithUnits } from '@/lib/format'
|
||||||
import { useQuoteReply } from './use-quote-reply'
|
import { useQuoteReply } from './use-quote-reply'
|
||||||
import { UNKNOWN_LINK_REL } from '@/lib/constants'
|
import { UNKNOWN_LINK_REL } from '@/lib/constants'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import { CarouselProvider } from './carousel'
|
import { CarouselProvider } from './carousel'
|
||||||
|
import Embed from './embed'
|
||||||
|
|
||||||
function BioItem ({ item, handleClick }) {
|
function BioItem ({ item, handleClick }) {
|
||||||
const { me } = useMe()
|
const { me } = useMe()
|
||||||
@ -50,10 +51,18 @@ function BioItem ({ item, handleClick }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ItemEmbed ({ url, imgproxyUrls }) {
|
function ItemEmbed ({ url, imgproxyUrls }) {
|
||||||
const src = IMGPROXY_URL_REGEXP.test(url) ? decodeProxyUrl(url) : url
|
if (imgproxyUrls) {
|
||||||
const srcSet = imgproxyUrls?.[url]
|
const src = IMGPROXY_URL_REGEXP.test(url) ? decodeProxyUrl(url) : url
|
||||||
|
const srcSet = imgproxyUrls?.[url]
|
||||||
|
return <MediaOrLink src={src} srcSet={srcSet} topLevel linkFallback={false} />
|
||||||
|
}
|
||||||
|
|
||||||
return <MediaOrLink src={src} srcSet={srcSet} topLevel linkFallback={false} />
|
const provider = parseEmbedUrl(url)
|
||||||
|
if (provider) {
|
||||||
|
return <Embed url={url} {...provider} topLevel />
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
function FwdUsers ({ forwards }) {
|
function FwdUsers ({ forwards }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user