Bluesky app fork with some witchin' additions 💫

add ref_src (#3532)

authored by samuel.fm and committed by

GitHub 4c95ec2e 9fb20915

+13 -4
+6 -1
bskyembed/src/components/link.tsx
··· 8 8 href: string 9 9 className?: string 10 10 } & h.JSX.HTMLAttributes<HTMLAnchorElement>) { 11 + const newSearchParam = new URLSearchParams() 12 + newSearchParam.set('ref_src', 'embed') 13 + 11 14 return ( 12 15 <a 13 - href={href.startsWith('http') ? href : `https://bsky.app${href}`} 16 + href={`${ 17 + href.startsWith('http') ? href : `https://bsky.app${href}` 18 + }?${newSearchParam.toString()}`} 14 19 target="_blank" 15 20 rel="noopener noreferrer nofollow" 16 21 onClick={evt => evt.stopPropagation()}
+1 -1
bskyembed/src/screens/landing.tsx
··· 242 242 } 243 243 244 244 function toShareUrl(path: string) { 245 - return `https://bsky.app${path}` 245 + return `https://bsky.app${path}?ref_src=embed` 246 246 } 247 247 248 248 /**
+6 -2
src/components/dialogs/Embed.tsx
··· 58 58 }, [copied]) 59 59 60 60 const snippet = React.useMemo(() => { 61 + function toEmbedUrl(href: string) { 62 + return toShareUrl(href) + '?ref_src=embed' 63 + } 64 + 61 65 const lang = record.langs && record.langs.length > 0 ? record.langs[0] : '' 62 - const profileHref = toShareUrl(['/profile', postAuthor.did].join('/')) 66 + const profileHref = toEmbedUrl(['/profile', postAuthor.did].join('/')) 63 67 const urip = new AtUri(postUri) 64 - const href = toShareUrl( 68 + const href = toEmbedUrl( 65 69 ['/profile', postAuthor.did, 'post', urip.rkey].join('/'), 66 70 ) 67 71