design: change weird profile overlap to a list
This commit is contained in:
1 parent
6c6a3e3e72
commit
1834b90375
5 files changed
+88
-49
No files matched your search
@@ -22,6 +22,8 @@
|
||||
} from 'svelte-hero-icons'
|
||||
import Expandable from '../ui/Expandable.svelte'
|
||||
import LabelStat from '../ui/LabelStat.svelte'
|
||||
import ItemList from './generic/ItemList.svelte'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
|
||||
export let site: SiteView
|
||||
export let taglines: Tagline[] | undefined = undefined
|
||||
@@ -111,28 +113,15 @@
|
||||
<svelte:fragment slot="title">
|
||||
<Icon src={UserGroup} size="15" mini /> Admins
|
||||
</svelte:fragment>
|
||||
<div
|
||||
class="flex items-center flex-wrap group transition-all
|
||||
cursor-pointer"
|
||||
>
|
||||
{#each admins as admin}
|
||||
<Popover openOnHover placement="top">
|
||||
<a
|
||||
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all -mx-0.5 group-hover:mx-0.5"
|
||||
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>
|
||||
<ItemList
|
||||
items={admins.map((a) => ({
|
||||
id: a.person.id,
|
||||
name: a.person.name,
|
||||
url: userLink(a.person),
|
||||
avatar: a.person.avatar,
|
||||
instance: new URL(a.person.actor_id).hostname,
|
||||
}))}
|
||||
/>
|
||||
</Expandable>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<script lang="ts">
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { flip } from 'svelte/animate'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
|
||||
export let items: {
|
||||
avatar?: string
|
||||
name: string
|
||||
instance?: string
|
||||
id: number
|
||||
url: string
|
||||
}[]
|
||||
</script>
|
||||
|
||||
{#each items.sort((a, b) => a.name.localeCompare(b.name)) as item (item.id)}
|
||||
<div
|
||||
class="inline-flex w-full"
|
||||
animate:flip={{ duration: 500, easing: expoOut }}
|
||||
>
|
||||
<Button
|
||||
class="font-normal w-full h-max"
|
||||
color="tertiary"
|
||||
alignment="left"
|
||||
href={item.url}
|
||||
>
|
||||
<div class="flex-none">
|
||||
<Avatar
|
||||
url={item.avatar}
|
||||
alt={item.name}
|
||||
title={item.name}
|
||||
width={24}
|
||||
slot="prefix"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col max-w-full break-words">
|
||||
<span>{item.name}</span>
|
||||
{#if item.instance}
|
||||
<span class="text-xs text-slate-600 dark:text-zinc-400">
|
||||
{item.instance}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
{/each}
|
||||
@@ -26,7 +26,7 @@
|
||||
url={follow.icon}
|
||||
alt={follow.name}
|
||||
title={follow.title}
|
||||
width={20}
|
||||
width={24}
|
||||
slot="prefix"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user