feat: show community in sidebar in a post

This commit is contained in:
Xyphyn committed 2023-10-12 15:41:42 -07:00
1 parent 010ae783cc
commit 05d26158f8
3 files changed
+12 -3

No files matched your search

@@ -39,7 +39,7 @@
import { publishedToDate } from '$lib/components/util/date.js'
export let community_view: CommunityView
export let moderators: CommunityModeratorView[]
export let moderators: CommunityModeratorView[] = []
let loading = {
blocking: false,
@@ -181,7 +181,7 @@
<FormattedNumber number={community_view.counts.comments} />
</span>
</div>
{#if moderators}
{#if moderators && moderators.length > 0}
<div class="flex flex-col gap-2 max-w-full">
<span class="font-bold">Moderators</span>
<div
@@ -1,5 +1,6 @@
import { env } from '$env/dynamic/public'
import { profile } from '$lib/auth.js'
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import { getClient } from '$lib/lemmy.js'
import { SSR_ENABLED, userSettings } from '$lib/settings.js'
import { error } from '@sveltejs/kit'
@@ -47,5 +48,13 @@ export async function load({ params, url, fetch }) {
streamed: {
comments: getClient(params.instance, fetch).getComments(commentParams),
},
slots: {
sidebar: {
component: CommunityCard,
props: {
community_view: post.community_view,
},
},
},
}
}