feat: show admins of instance
This commit is contained in:
1 parent
368d61e356
commit
6a106db839
3 files changed
+36
-4
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "photon-lemmy",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import type { SiteView, Tagline } from 'lemmy-js-client'
|
||||
import { Button } from 'mono-svelte'
|
||||
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
|
||||
import { Button, Popover } from 'mono-svelte'
|
||||
import {
|
||||
Calendar,
|
||||
ChatBubbleOvalLeftEllipsis,
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
export let site: SiteView
|
||||
export let taglines: Tagline[] | undefined = undefined
|
||||
export let admins: PersonView[] | undefined = undefined
|
||||
</script>
|
||||
|
||||
<StickyCard>
|
||||
@@ -60,6 +61,33 @@
|
||||
Modlog
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{#if admins}
|
||||
<span class="font-bold">Admins</span>
|
||||
<div
|
||||
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
|
||||
cursor-pointer"
|
||||
>
|
||||
{#each admins as admin (admin.person.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/{admin.person.name}@{new URL(admin.person.actor_id)
|
||||
.hostname}"
|
||||
slot="target"
|
||||
>
|
||||
<Avatar
|
||||
width={28}
|
||||
url={admin.person.avatar}
|
||||
alt={admin.person.name}
|
||||
/>
|
||||
</a>
|
||||
<span class="font-bold">{admin.person.name}</span>
|
||||
</Popover>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
<hr class="border-slate-300 dark:border-zinc-700" />
|
||||
{#if taglines && taglines.length > 0}
|
||||
<Markdown
|
||||
source={taglines[Math.floor(Math.random() * taglines.length)].content}
|
||||
|
||||
@@ -79,7 +79,11 @@
|
||||
</div>
|
||||
</StickyCard>
|
||||
{:then site}
|
||||
<SiteCard site={site.site_view} taglines={site.taglines} />
|
||||
<SiteCard
|
||||
site={site.site_view}
|
||||
taglines={site.taglines}
|
||||
admins={site.admins}
|
||||
/>
|
||||
{:catch}
|
||||
<StickyCard>
|
||||
<h1 class="font-bold text-lg">Failed to load</h1>
|
||||
|
||||
Reference in new issue
Block a user