From 9d52c0b5dfd9cf1a0e25e69a5ca0e27da307ee1b Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Mon, 4 Sep 2023 14:45:34 -0700 Subject: [PATCH] feat: show moderators of instance, close #138 --- .../lemmy/community/CommunityCard.svelte | 33 +++++++++++++++++-- src/routes/+page.svelte | 6 +++- src/routes/c/[name]/+page.svelte | 10 ++++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/lib/components/lemmy/community/CommunityCard.svelte b/src/lib/components/lemmy/community/CommunityCard.svelte index 3b1804bb..346a6a2d 100644 --- a/src/lib/components/lemmy/community/CommunityCard.svelte +++ b/src/lib/components/lemmy/community/CommunityCard.svelte @@ -4,13 +4,13 @@ import Markdown from '$lib/components/markdown/Markdown.svelte' import Avatar from '$lib/components/ui/Avatar.svelte' import StickyCard from '$lib/components/ui/StickyCard.svelte' - import { toast } from 'mono-svelte' + import { Popover, toast } from 'mono-svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte' import { getClient } from '$lib/lemmy.js' import { addSubscription } from '$lib/lemmy/user.js' import { fullCommunityName } from '$lib/util.js' - import type { CommunityView } from 'lemmy-js-client' + import type { CommunityModeratorView, CommunityView } from 'lemmy-js-client' import { Button } from 'mono-svelte' import { Calendar, @@ -24,6 +24,7 @@ } from 'svelte-hero-icons' export let community_view: CommunityView + export let moderators: CommunityModeratorView[] let loading = { blocking: false, @@ -108,6 +109,34 @@ + {#if moderators} +
+ Moderators +
+ {#each moderators as moderator (moderator.moderator.id)} + + + + + {moderator.moderator.name} + + {/each} +
+
+ {/if} {#if $profile?.jwt}