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
@@ -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}
|
||||
Reference in new issue
Block a user