feat: make community list expandable
This commit is contained in:
1 parent
df06eca4e6
commit
04c89fed13
2 files changed
+35
-10
No files matched your search
@@ -1,15 +1,28 @@
|
|||||||
<script>
|
<script lang="ts">
|
||||||
|
import { Disclosure } from 'mono-svelte'
|
||||||
import { Disclosure } from "mono-svelte"
|
import { ChevronDown, Icon } from 'svelte-hero-icons'
|
||||||
import { ChevronDown, Icon } from "svelte-hero-icons"
|
export let open: boolean = false
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Disclosure class="items-start justify-items-start gap-2 {$$props.class}">
|
<Disclosure
|
||||||
<div slot="summary" class="font-medium w-full text-left flex flex-row items-center justify-between">
|
bind:open
|
||||||
<div class="flex flex-row gap-1 items-center"><slot name="title" /></div>
|
class="items-start justify-items-start gap-2 {$$props.class}"
|
||||||
<Icon src={ChevronDown} size="20" mini />
|
>
|
||||||
|
<div
|
||||||
|
slot="summary"
|
||||||
|
class="font-medium w-full text-left flex flex-row items-center justify-between"
|
||||||
|
>
|
||||||
|
<div class="flex flex-row gap-1 items-center w-full">
|
||||||
|
<slot name="title" />
|
||||||
|
</div>
|
||||||
|
<Icon
|
||||||
|
src={ChevronDown}
|
||||||
|
size="20"
|
||||||
|
mini
|
||||||
|
class="{open ? 'rotate-180' : ''} transition-transform"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="pt-2">
|
<div class="pt-2">
|
||||||
<slot /></div>
|
<slot />
|
||||||
|
</div>
|
||||||
</Disclosure>
|
</Disclosure>
|
||||||
@@ -19,6 +19,8 @@
|
|||||||
import { expoOut } from 'svelte/easing'
|
import { expoOut } from 'svelte/easing'
|
||||||
import { Button } from 'mono-svelte'
|
import { Button } from 'mono-svelte'
|
||||||
import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js'
|
import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js'
|
||||||
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
|
import EndPlaceholder from '../EndPlaceholder.svelte'
|
||||||
|
|
||||||
export let route = ''
|
export let route = ''
|
||||||
</script>
|
</script>
|
||||||
@@ -81,7 +83,17 @@
|
|||||||
<hr class="border-slate-200 dark:border-zinc-800 my-1" />
|
<hr class="border-slate-200 dark:border-zinc-800 my-1" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<Expandable open>
|
||||||
|
<span slot="title" class="px-2 py-1 w-full">
|
||||||
|
<EndPlaceholder>
|
||||||
|
Subscribed
|
||||||
|
<span slot="action" class="dark:text-white text-black">
|
||||||
|
{$profile.user.follows.length}
|
||||||
|
</span>
|
||||||
|
</EndPlaceholder>
|
||||||
|
</span>
|
||||||
<CommunityList items={$profile.user.follows.map((i) => i.community)} />
|
<CommunityList items={$profile.user.follows.map((i) => i.community)} />
|
||||||
|
</Expandable>
|
||||||
{:else}
|
{:else}
|
||||||
<SidebarButton href="/login" title="Log In">
|
<SidebarButton href="/login" title="Log In">
|
||||||
<Icon mini src={ArrowLeftOnRectangle} size="20" />
|
<Icon mini src={ArrowLeftOnRectangle} size="20" />
|
||||||
|
|||||||
Reference in new issue
Block a user