feat: fix sidebar communities
This commit is contained in:
1 parent
9b15224b84
commit
c1abaa386a
2 files changed
+12
-3
No files matched your search
@@ -2,14 +2,21 @@
|
|||||||
import Button from '$lib/components/input/Button.svelte'
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import type { Community } from 'lemmy-js-client'
|
import type { Community } from 'lemmy-js-client'
|
||||||
|
import { flip } from 'svelte/animate'
|
||||||
|
import { expoOut } from 'svelte/easing'
|
||||||
|
import { slide } from 'svelte/transition'
|
||||||
|
|
||||||
export let items: Community[]
|
export let items: Community[]
|
||||||
export let expanded: boolean
|
export let expanded: boolean
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#each items.sort((a, b) => a.title.localeCompare(b.title)) as follow}
|
{#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)}
|
||||||
|
<div
|
||||||
|
class="inline-flex w-full"
|
||||||
|
animate:flip={{ duration: 500, easing: expoOut }}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
class="hover:bg-slate-200 {expanded ? '' : '!p-1.5'}"
|
class="hover:bg-slate-200 w-full h-max {expanded ? '' : '!p-1.5'}"
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
alignment="left"
|
alignment="left"
|
||||||
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
|
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
|
||||||
@@ -27,4 +34,5 @@
|
|||||||
{follow.title}
|
{follow.title}
|
||||||
</span>
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -115,7 +115,8 @@
|
|||||||
|
|
||||||
addSubscription(
|
addSubscription(
|
||||||
community.community,
|
community.community,
|
||||||
res.community_view.subscribed == 'Subscribed'
|
res.community_view.subscribed == 'Subscribed' ||
|
||||||
|
res.community_view.subscribed == 'Pending'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in new issue
Block a user