feat: show crossposts
This commit is contained in:
1 parent
a6ca698625
commit
a971e04bed
2 files changed
+35
-1
No files matched your search
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
export let community: Community
|
export let community: Community
|
||||||
export let avatar: boolean = false
|
export let avatar: boolean = false
|
||||||
|
export let name: boolean = true
|
||||||
export let avatarSize: number = 24
|
export let avatarSize: number = 24
|
||||||
export let showInstance: boolean | undefined = undefined
|
export let showInstance: boolean | undefined = undefined
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if name}
|
||||||
<span class="flex gap-0">
|
<span class="flex gap-0">
|
||||||
{#if showInstance != undefined ? showInstance : $userSettings.showInstances.community}
|
{#if showInstance != undefined ? showInstance : $userSettings.showInstances.community}
|
||||||
{community.title}
|
{community.title}
|
||||||
@@ -37,4 +39,5 @@
|
|||||||
{community.title}
|
{community.title}
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { buildCommentsTreeAsync } from '$lib/components/lemmy/comment/comments.js'
|
import { buildCommentsTreeAsync } from '$lib/components/lemmy/comment/comments.js'
|
||||||
import Comments from '$lib/components/lemmy/comment/Comments.svelte'
|
import Comments from '$lib/components/lemmy/comment/Comments.svelte'
|
||||||
import { isImage, isVideo } from '$lib/ui/image.js'
|
import { isImage, isVideo } from '$lib/ui/image.js'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient, getInstance } from '$lib/lemmy.js'
|
||||||
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import { instance } from '$lib/instance.js'
|
import { instance } from '$lib/instance.js'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
|
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||||
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
|
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -165,6 +168,34 @@
|
|||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{#if data.post.cross_posts?.length > 0}
|
||||||
|
<div class="text-sm font-bold mt-2">
|
||||||
|
<SectionTitle class="text-inherit dark:text-inherit">
|
||||||
|
Crossposts <span class="text-slate-600 dark:text-zinc-400 text-xs ml-1">
|
||||||
|
{data.post.cross_posts.length}
|
||||||
|
</span>
|
||||||
|
</SectionTitle>
|
||||||
|
<div class="divide-y divide-slate-200 dark:divide-zinc-800 flex flex-col">
|
||||||
|
{#each data.post.cross_posts as crosspost}
|
||||||
|
<div class="py-2.5 flex flex-col gap-1">
|
||||||
|
<span class="text-xs flex flex-col pointer-events-none">
|
||||||
|
<CommunityLink
|
||||||
|
community={crosspost.community}
|
||||||
|
avatarSize={22}
|
||||||
|
avatar={true}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<Link
|
||||||
|
class="text-sm"
|
||||||
|
href="/post/{$page.params.instance}/{crosspost.post.id}"
|
||||||
|
>
|
||||||
|
{crosspost.post.name}
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 flex flex-col gap-2">
|
<div class="mt-4 flex flex-col gap-2">
|
||||||
<div class="font-bold text-lg">
|
<div class="font-bold text-lg">
|
||||||
|
|||||||
Reference in new issue
Block a user