feat: add embeds to post pages

This commit is contained in:
Xylight committed 2023-11-27 18:43:57 -08:00
1 parent 3c6f6c3b5d
commit 399eb9c1fb
3 files changed
+28 -32

No files matched your search

@@ -27,7 +27,7 @@
export let type: IframeType = 'none'
export let thumbnail: string | undefined = undefined
export let url: string
let opened = !$userSettings.embeds.clickToView
export let opened = !$userSettings.embeds.clickToView
const urlToEmbed = (inputUrl: string) => {
if (type == 'youtube') {
@@ -16,6 +16,7 @@
export let view: 'card' | 'cozy' | 'list' | 'compact' = 'cozy'
export let post: Post
export let type: MediaType = 'none'
export let opened: boolean | undefined = undefined
</script>
{#if type == 'image'}
@@ -92,7 +93,12 @@
<p class="text-base">Go to the post to view this video.</p>
</a>
{:else if type == 'iframe' && (view == 'cozy' || view == 'card') && post.url}
<PostIframe thumbnail={post.thumbnail_url} type="youtube" url={post.url} />
<PostIframe
thumbnail={post.thumbnail_url}
type="youtube"
url={post.url}
{opened}
/>
{:else if type == 'embed' && post.url}
<PostLink
url={post.url}