Rearrange post meta for better alignment in compact post view (#63)

* Compact post view: Allow post meta to fill the card & align post title with thumbnail

* misc: fix gap

---------

Co-authored-by: zamuz <>
Co-authored-by: Xyphyn <james@xylight.dev>
This commit is contained in:
authored and GitHub committed 2023-08-02 14:37:16 -07:00
1 parent 87612d6507
commit 6b496f43f5
1 file changed
+28 -27
+28 -27
View File
@@ -16,31 +16,32 @@
</script> </script>
<Card class="bg-white flex flex-col w-full p-5 gap-2.5"> <Card class="bg-white flex flex-col w-full p-5 gap-2.5">
<div class="flex flex-row w-full gap-2.5"> <div class="flex flex-col gap-1">
<div class="flex flex-col gap-1.5 grow"> <PostMeta
<PostMeta community={hideCommunity ? undefined : post.community}
community={hideCommunity ? undefined : post.community} user={post.creator}
user={post.creator} published={new Date(post.post.published + 'Z')}
published={new Date(post.post.published + 'Z')} upvotes={post.counts.upvotes}
upvotes={post.counts.upvotes} downvotes={post.counts.downvotes}
downvotes={post.counts.downvotes} deleted={post.post.deleted}
deleted={post.post.deleted} removed={post.post.removed}
removed={post.post.removed} locked={post.post.locked}
locked={post.post.locked} featured={post.post.featured_local || post.post.featured_community}
featured={post.post.featured_local || post.post.featured_community} nsfw={post.post.nsfw}
nsfw={post.post.nsfw} saved={post.saved}
saved={post.saved} />
/>
<a <a
href="/post/{getInstance()}/{post.post.id}" href="/post/{getInstance()}/{post.post.id}"
class="font-medium" class="font-medium"
class:text-slate-500={post.read && $userSettings.markReadPosts} class:text-slate-500={post.read && $userSettings.markReadPosts}
class:dark:text-zinc-400={post.read && $userSettings.markReadPosts} class:dark:text-zinc-400={post.read && $userSettings.markReadPosts}
> >
{post.post.name} {post.post.name}
</a> </a>
</div> </div>
{#if $userSettings.showCompactPosts && (post.post.thumbnail_url || isImage(post.post.url))} {#if $userSettings.showCompactPosts && (post.post.thumbnail_url || isImage(post.post.url))}
<div class="flex flex-row w-full gap-2.5">
<div class="flex-none w-24 h-24"> <div class="flex-none w-24 h-24">
<a href="/post/{getInstance()}/{post.post.id}"> <a href="/post/{getInstance()}/{post.post.id}">
{#if post.post.thumbnail_url} {#if post.post.thumbnail_url}
@@ -60,8 +61,8 @@
{/if} {/if}
</a> </a>
</div> </div>
{/if} </div>
</div> {/if}
{#if !$userSettings.showCompactPosts} {#if !$userSettings.showCompactPosts}
{#if post.post.url && !post.post.thumbnail_url} {#if post.post.url && !post.post.thumbnail_url}
<a <a