feat: show moderators of instance, close #138
This commit is contained in:
1 parent
6a106db839
commit
9d52c0b5df
3 files changed
+44
-5
No files matched your search
@@ -4,13 +4,13 @@
|
|||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import StickyCard from '$lib/components/ui/StickyCard.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 FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
import { addSubscription } from '$lib/lemmy/user.js'
|
import { addSubscription } from '$lib/lemmy/user.js'
|
||||||
import { fullCommunityName } from '$lib/util.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 { Button } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
Calendar,
|
Calendar,
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
|
|
||||||
export let community_view: CommunityView
|
export let community_view: CommunityView
|
||||||
|
export let moderators: CommunityModeratorView[]
|
||||||
|
|
||||||
let loading = {
|
let loading = {
|
||||||
blocking: false,
|
blocking: false,
|
||||||
@@ -108,6 +109,34 @@
|
|||||||
<FormattedNumber number={community_view.counts.comments} />
|
<FormattedNumber number={community_view.counts.comments} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{#if moderators}
|
||||||
|
<div class="flex flex-col gap-2 max-w-full">
|
||||||
|
<span class="font-bold">Moderators</span>
|
||||||
|
<div
|
||||||
|
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
|
||||||
|
cursor-pointer"
|
||||||
|
>
|
||||||
|
{#each moderators as moderator (moderator.moderator.id)}
|
||||||
|
<Popover openOnHover origin="top-left" class="transition-all">
|
||||||
|
<a
|
||||||
|
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all"
|
||||||
|
href="/u/{moderator.moderator.name}@{new URL(
|
||||||
|
moderator.moderator.actor_id
|
||||||
|
).hostname}"
|
||||||
|
slot="target"
|
||||||
|
>
|
||||||
|
<Avatar
|
||||||
|
width={28}
|
||||||
|
url={moderator.moderator.avatar}
|
||||||
|
alt={moderator.moderator.name}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<span class="font-bold">{moderator.moderator.name}</span>
|
||||||
|
</Popover>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{#if $profile?.jwt}
|
{#if $profile?.jwt}
|
||||||
<div class="w-full mt-2 flex flex-col gap-2">
|
<div class="w-full mt-2 flex flex-col gap-2">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -24,7 +24,11 @@
|
|||||||
<span slot="title">About</span>
|
<span slot="title">About</span>
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
{#await data.streamed.site then site}
|
{#await data.streamed.site then site}
|
||||||
<SiteCard site={site.site_view} taglines={site.taglines} />
|
<SiteCard
|
||||||
|
site={site.site_view}
|
||||||
|
taglines={site.taglines}
|
||||||
|
admins={site.admins}
|
||||||
|
/>
|
||||||
{/await}
|
{/await}
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -28,7 +28,10 @@
|
|||||||
<Modal bind:open={sidebar}>
|
<Modal bind:open={sidebar}>
|
||||||
<span slot="title">About</span>
|
<span slot="title">About</span>
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
<CommunityCard community_view={data.community.community_view} />
|
<CommunityCard
|
||||||
|
community_view={data.community.community_view}
|
||||||
|
moderators={data.community.moderators}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
@@ -66,6 +69,9 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden xl:block">
|
<div class="hidden xl:block">
|
||||||
<CommunityCard community_view={data.community.community_view} />
|
<CommunityCard
|
||||||
|
community_view={data.community.community_view}
|
||||||
|
moderators={data.community.moderators}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user