Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Long press external embed to share (#2621)

* long press external embed to share

* use existing shareUrl function

authored by

Samuel Newman and committed by
GitHub
2f1ce117 2754121f

+15 -2
+15 -2
src/view/com/util/post-embeds/index.tsx
··· 1 - import React from 'react' 1 + import React, {useCallback} from 'react' 2 2 import { 3 3 StyleSheet, 4 4 StyleProp, ··· 29 29 import {isCauseALabelOnUri, isQuoteBlurred} from 'lib/moderation' 30 30 import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard' 31 31 import {ContentHider} from '../moderation/ContentHider' 32 + import {isNative} from '#/platform/detection' 33 + import {shareUrl} from '#/lib/sharing' 32 34 33 35 type Embed = 34 36 | AppBskyEmbedRecord.View ··· 50 52 }) { 51 53 const pal = usePalette('default') 52 54 const {openLightbox} = useLightboxControls() 55 + 56 + const externalUri = AppBskyEmbedExternal.isView(embed) 57 + ? embed.external.uri 58 + : null 59 + 60 + const onShareExternal = useCallback(() => { 61 + if (externalUri && isNative) { 62 + shareUrl(externalUri) 63 + } 64 + }, [externalUri]) 53 65 54 66 // quote post with media 55 67 // = ··· 164 176 anchorNoUnderline 165 177 href={link.uri} 166 178 style={[styles.extOuter, pal.view, pal.borderDark, style]} 167 - hoverStyle={{borderColor: pal.colors.borderLinkHover}}> 179 + hoverStyle={{borderColor: pal.colors.borderLinkHover}} 180 + onLongPress={onShareExternal}> 168 181 <ExternalLinkEmbed link={link} /> 169 182 </Link> 170 183 )