diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte
index 9ec09608..5534cebb 100644
--- a/src/lib/components/lemmy/post/Post.svelte
+++ b/src/lib/components/lemmy/post/Post.svelte
@@ -86,7 +86,7 @@
color={view != 'card' ? 'none' : 'distinct'}
class="post relative max-w-full min-w-0 w-full group cursor-pointer
{view != 'card' ? 'bg-transparent !border-0' : 'p-5'} {view == 'compact'
- ? 'py-4 list-type'
+ ? 'py-3 list-type compact-view'
: view == 'list'
? 'py-5 list-type'
: 'py-5 flex flex-col gap-2'} {$$props.class}"
@@ -122,6 +122,7 @@
read={post.read}
style="grid-area: meta;"
tags={tags?.tags}
+ {view}
>
@@ -147,6 +148,7 @@
? 'mr-2'
: 'ml-2'} flex-shrink no-list-margin"
style="grid-area: media;"
+ {view}
/>
{/if}
{/key}
@@ -154,7 +156,7 @@
{/if}
{#if actions}
-
+
{:else if view == 'compact'}
@@ -187,7 +189,13 @@
grid-template-columns: var(--template-columns, 1fr auto);
}
- :global(.list-type > *:not(.no-list-margin):not(:first-child)) {
+ :global(.compact-view > *:not(.no-list-margin):not(:first-child)) {
+ margin-top: 0.3rem;
+ }
+
+ :global(
+ .list-type:not(.compact-view) > *:not(.no-list-margin):not(:first-child)
+ ) {
margin-top: 0.5rem;
}
diff --git a/src/lib/components/lemmy/post/PostActions.svelte b/src/lib/components/lemmy/post/PostActions.svelte
index 259d92a4..f5568e0c 100644
--- a/src/lib/components/lemmy/post/PostActions.svelte
+++ b/src/lib/components/lemmy/post/PostActions.svelte
@@ -44,7 +44,7 @@
} from '$lib/lemmy/contentview.js'
import { setSessionStorage } from '$lib/session.js'
import { goto } from '$app/navigation'
- import { userSettings } from '$lib/settings.js'
+ import { userSettings, type View } from '$lib/settings.js'
import {
Button,
Menu,
@@ -66,6 +66,7 @@
export let post: PostView
export let type: MediaType | undefined = undefined
+ export let view: View = 'cozy'
export let debug: boolean = false
const dispatcher = createEventDispatcher<{ edit: PostView; hide: boolean }>()
@@ -85,6 +86,9 @@
const stripSubdomain = (url: string) =>
new URL(url).hostname.split('.').slice(-2).join('.')
+
+ $: buttonHeight = view == 'compact' ? 'h-[30px]' : 'h-8'
+ $: buttonSquare = view == 'compact' ? 'w-[30px] h-[30px]' : 'w-8 h-8'
{#if fediseerData}
@@ -130,7 +134,7 @@
{/if}
@@ -162,14 +166,20 @@
{/if}
{#if $profile?.user && (amMod($profile.user, post.community) || isAdmin($profile.user))}
-
+
{/if}
{#if $profile?.jwt}
@@ -180,7 +190,8 @@
post.saved = await save(post, !post.saved, $profile?.jwt)
saving = false
}}
- size="square-md"
+ size="custom"
+ class={buttonSquare}
color="ghost"
loading={saving}
disabled={saving}
@@ -197,7 +208,8 @@
{#if post.post.url && type == 'embed'}
diff --git a/src/lib/components/lemmy/post/PostMeta.svelte b/src/lib/components/lemmy/post/PostMeta.svelte
index 5403b10e..622eb3fd 100644
--- a/src/lib/components/lemmy/post/PostMeta.svelte
+++ b/src/lib/components/lemmy/post/PostMeta.svelte
@@ -12,7 +12,7 @@
])
export const parseTags = (
- title?: string
+ title?: string,
): { tags: Tag[]; title?: string } => {
if (!title) return { tags: [] }
@@ -22,7 +22,7 @@
extracted.push(
textToTag.get(content) ?? {
content: content,
- }
+ },
)
return ''
})
@@ -56,7 +56,7 @@
import { profile } from '$lib/auth.js'
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
import ShieldIcon from '../moderation/ShieldIcon.svelte'
- import { userSettings } from '$lib/settings'
+ import { userSettings, type View } from '$lib/settings'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import { t } from '$lib/translations'
import type { IconSource } from 'svelte-hero-icons'
@@ -71,6 +71,8 @@
export let id: number | undefined = undefined
export let read: boolean = false
+ export let view: View = 'cozy'
+
// Badges
export let badges = {
nsfw: false,
@@ -245,17 +247,24 @@
{#if title && id}
-
+
{:else}
diff --git a/src/lib/components/lemmy/post/PostVote.svelte b/src/lib/components/lemmy/post/PostVote.svelte
index 38048d95..3a7377f3 100644
--- a/src/lib/components/lemmy/post/PostVote.svelte
+++ b/src/lib/components/lemmy/post/PostVote.svelte
@@ -5,7 +5,7 @@
export const shouldShowVoteColor = (
vote: number,
- type: 'upvotes' | 'downvotes'
+ type: 'upvotes' | 'downvotes',
): string =>
(vote == -1 && type == 'downvotes') || (vote == 1 && type == 'upvotes')
? voteColor(vote)
@@ -57,7 +57,7 @@