feat: change compact post style
This commit is contained in:
1 parent
4ba2235c01
commit
9833a775c4
3 files changed
+145
-125
No files matched your search
@@ -10,32 +10,39 @@
|
||||
export let posts: PostView[]
|
||||
</script>
|
||||
|
||||
{#if posts.length == 0}
|
||||
<div class="h-full grid place-items-center">
|
||||
<Placeholder
|
||||
icon={ArchiveBox}
|
||||
title="No posts"
|
||||
description="There are no posts that match this filter."
|
||||
>
|
||||
<Button href="/communities">
|
||||
<Icon src={Plus} size="16" mini slot="icon" />
|
||||
<span>Follow some communities</span>
|
||||
</Button>
|
||||
</Placeholder>
|
||||
</div>
|
||||
{:else}
|
||||
{#each posts as post, index (post.post.id)}
|
||||
{#if !($userSettings.hidePosts.deleted && post.post.deleted) && !($userSettings.hidePosts.removed && post.post.removed)}
|
||||
<div
|
||||
in:fly={{
|
||||
y: -8,
|
||||
duration: 500,
|
||||
opacity: 0,
|
||||
delay: index < 4 ? index * 100 : 0,
|
||||
}}
|
||||
<div
|
||||
class="flex flex-col {!$userSettings.showCompactPosts
|
||||
? 'gap-3 md:gap-4'
|
||||
: ''} divide-slate-200 dark:divide-zinc-800"
|
||||
class:divide-y={$userSettings.showCompactPosts}
|
||||
>
|
||||
{#if posts.length == 0}
|
||||
<div class="h-full grid place-items-center">
|
||||
<Placeholder
|
||||
icon={ArchiveBox}
|
||||
title="No posts"
|
||||
description="There are no posts that match this filter."
|
||||
>
|
||||
<Post {post} />
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
<Button href="/communities">
|
||||
<Icon src={Plus} size="16" mini slot="icon" />
|
||||
<span>Follow some communities</span>
|
||||
</Button>
|
||||
</Placeholder>
|
||||
</div>
|
||||
{:else}
|
||||
{#each posts as post, index (post.post.id)}
|
||||
{#if !($userSettings.hidePosts.deleted && post.post.deleted) && !($userSettings.hidePosts.removed && post.post.removed)}
|
||||
<div
|
||||
in:fly={{
|
||||
y: -8,
|
||||
duration: 500,
|
||||
opacity: 0,
|
||||
delay: index < 4 ? index * 100 : 0,
|
||||
}}
|
||||
>
|
||||
<Post compact={$userSettings.showCompactPosts} {post} />
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
Reference in new issue
Block a user