feat: show community in sidebar in a post
This commit is contained in:
1 parent
010ae783cc
commit
05d26158f8
3 files changed
+12
-3
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "photon-lemmy",
|
"name": "photon-lemmy",
|
||||||
"version": "1.19.2",
|
"version": "1.19.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
|
|
||||||
export let community_view: CommunityView
|
export let community_view: CommunityView
|
||||||
export let moderators: CommunityModeratorView[]
|
export let moderators: CommunityModeratorView[] = []
|
||||||
|
|
||||||
let loading = {
|
let loading = {
|
||||||
blocking: false,
|
blocking: false,
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
<FormattedNumber number={community_view.counts.comments} />
|
<FormattedNumber number={community_view.counts.comments} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{#if moderators}
|
{#if moderators && moderators.length > 0}
|
||||||
<div class="flex flex-col gap-2 max-w-full">
|
<div class="flex flex-col gap-2 max-w-full">
|
||||||
<span class="font-bold">Moderators</span>
|
<span class="font-bold">Moderators</span>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { env } from '$env/dynamic/public'
|
import { env } from '$env/dynamic/public'
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
|
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
import { SSR_ENABLED, userSettings } from '$lib/settings.js'
|
import { SSR_ENABLED, userSettings } from '$lib/settings.js'
|
||||||
import { error } from '@sveltejs/kit'
|
import { error } from '@sveltejs/kit'
|
||||||
@@ -47,5 +48,13 @@ export async function load({ params, url, fetch }) {
|
|||||||
streamed: {
|
streamed: {
|
||||||
comments: getClient(params.instance, fetch).getComments(commentParams),
|
comments: getClient(params.instance, fetch).getComments(commentParams),
|
||||||
},
|
},
|
||||||
|
slots: {
|
||||||
|
sidebar: {
|
||||||
|
component: CommunityCard,
|
||||||
|
props: {
|
||||||
|
community_view: post.community_view,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user