tangled
alpha
login
or
join now
robinwobin.dev
/
witchsky.app
forked from
jollywhoppers.com/witchsky.app
0
fork
atom
Bluesky app fork with some witchin' additions 💫
0
fork
atom
overview
issues
pulls
pipelines
add ref_src (#3532)
authored by
samuel.fm
and committed by
GitHub
2 years ago
4c95ec2e
9fb20915
+13
-4
3 changed files
expand all
collapse all
unified
split
bskyembed
src
components
link.tsx
screens
landing.tsx
src
components
dialogs
Embed.tsx
+6
-1
bskyembed/src/components/link.tsx
···
8
8
href: string
9
9
className?: string
10
10
} & h.JSX.HTMLAttributes<HTMLAnchorElement>) {
11
11
+
const newSearchParam = new URLSearchParams()
12
12
+
newSearchParam.set('ref_src', 'embed')
13
13
+
11
14
return (
12
15
<a
13
13
-
href={href.startsWith('http') ? href : `https://bsky.app${href}`}
16
16
+
href={`${
17
17
+
href.startsWith('http') ? href : `https://bsky.app${href}`
18
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
245
-
return `https://bsky.app${path}`
245
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
61
+
function toEmbedUrl(href: string) {
62
62
+
return toShareUrl(href) + '?ref_src=embed'
63
63
+
}
64
64
+
61
65
const lang = record.langs && record.langs.length > 0 ? record.langs[0] : ''
62
62
-
const profileHref = toShareUrl(['/profile', postAuthor.did].join('/'))
66
66
+
const profileHref = toEmbedUrl(['/profile', postAuthor.did].join('/'))
63
67
const urip = new AtUri(postUri)
64
64
-
const href = toShareUrl(
68
68
+
const href = toEmbedUrl(
65
69
['/profile', postAuthor.did, 'post', urip.rkey].join('/'),
66
70
)
67
71