Fix external card long press on web (#10739)

This commit is contained in:
Samuel Newman
2026-06-06 00:04:21 +03:00
committed by GitHub
parent b236f274c3
commit fb8316fd85
3 changed files with 47 additions and 44 deletions
@@ -1,4 +1,4 @@
import {useCallback, useMemo} from 'react'
import {useMemo} from 'react'
import {type StyleProp, View, type ViewStyle} from 'react-native'
import {Image} from 'expo-image'
import {type AppBskyEmbedExternal} from '@atproto/api'
@@ -51,17 +51,19 @@ export const ExternalEmbed = ({
}, [link.uri, externalEmbedPrefs])
const hasMedia = Boolean(imageUri || embedPlayerParams)
const onPress = useCallback(() => {
const onPress = () => {
playHaptic('Light')
onOpen?.()
}, [playHaptic, onOpen])
}
const onShareExternal = useCallback(() => {
if (link.uri && IS_NATIVE) {
playHaptic('Heavy')
void shareUrl(link.uri)
}
}, [link.uri, playHaptic])
const onShareExternal = IS_NATIVE
? () => {
if (link.uri) {
playHaptic('Heavy')
void shareUrl(link.uri)
}
}
: undefined
if (
embedPlayerParams?.source === 'tenor' ||