about summary refs log tree commit diff
path: root/bskyembed
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-04-13 05:13:53 +0100
committerGitHub <noreply@github.com>2024-04-13 05:13:53 +0100
commit4c966e5d6d1cbafe7a41d58268ffcb2cee31abe8 (patch)
treec16f28032012c6123ea956b657656b9122b4ab66 /bskyembed
parent4b3ec5573241b9c71504dfd0bd5f181cbde19a49 (diff)
downloadvoidsky-4c966e5d6d1cbafe7a41d58268ffcb2cee31abe8.tar.zst
[Embeds] "Embed post" post dropdown option (#3513)
* add embed option to post dropdown menu

* put embed post button behind a gate

* increase line height in dialog

* add gate to gate name union

* hide embed button if PWI optout

* Ungate embed button

* Escape HTML, align implementations

* Make dialog conditionally rendered

* Memoize EmbedDialog

* Render dialog lazily

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'bskyembed')
-rw-r--r--bskyembed/src/screens/landing.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/bskyembed/src/screens/landing.tsx b/bskyembed/src/screens/landing.tsx
index 88e84ffb6..7c8ef2810 100644
--- a/bskyembed/src/screens/landing.tsx
+++ b/bskyembed/src/screens/landing.tsx
@@ -159,6 +159,7 @@ function Snippet({thread}: {thread: AppBskyFeedDefs.ThreadViewPost}) {
       return ''
     }
 
+    const lang = record.langs && record.langs.length > 0 ? record.langs[0] : ''
     const profileHref = toShareUrl(
       ['/profile', thread.post.author.did].join('/'),
     )
@@ -167,10 +168,9 @@ function Snippet({thread}: {thread: AppBskyFeedDefs.ThreadViewPost}) {
       ['/profile', thread.post.author.did, 'post', urip.rkey].join('/'),
     )
 
-    const lang = record.langs ? record.langs[0] : ''
-
     // x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x
-    // DO NOT ADD ANY NEW INTERPOLATIOONS BELOW WITHOUT ESCAPING THEM!
+    // DO NOT ADD ANY NEW INTERPOLATIONS BELOW WITHOUT ESCAPING THEM!
+    // Also, keep this code synced with the app code in Embed.tsx.
     // x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x
     return `<blockquote class="bluesky-embed" data-bluesky-uri="${escapeHtml(
       thread.post.uri,