feat: make comment items and posts consistent
This commit is contained in:
1 parent
30d5dc9bf2
commit
ae09c5ab92
5 files changed
+39
-27
No files matched your search
@@ -2,13 +2,21 @@
|
||||
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { getInstance } from '$lib/lemmy.js'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import type { CommentView } from 'lemmy-js-client'
|
||||
import { Button, Material } from 'mono-svelte'
|
||||
|
||||
export let comment: CommentView
|
||||
export let view = $userSettings.view
|
||||
</script>
|
||||
|
||||
<Material class="flex flex-col flex-1 gap-1" color="distinct" padding="lg">
|
||||
<Material
|
||||
class="flex flex-col flex-1 gap-1 {view == 'list' || view == 'compact'
|
||||
? '!bg-transparent !border-0 rounded-none'
|
||||
: 'p-5'} {view == 'list' ? 'py-5' : view == 'compact' ? 'py-4' : ''}"
|
||||
color="distinct"
|
||||
padding="none"
|
||||
>
|
||||
<div class="flex flex-row justify-between items-center">
|
||||
<PostMeta
|
||||
community={comment.community}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
export let post: PostView
|
||||
export let actions: boolean = true
|
||||
export let hideCommunity = false
|
||||
export let view: 'card' | 'list' | 'compact' = 'card'
|
||||
export let view: 'card' | 'list' | 'compact' = $userSettings.view
|
||||
|
||||
let loaded = false
|
||||
|
||||
@@ -151,25 +151,21 @@
|
||||
<div class="flex-none w-24 h-24">
|
||||
{#if !$userSettings.expandImages || (post.post.thumbnail_url && !isImage(post.post.url))}
|
||||
<a href={postLink(post.post)}>
|
||||
{#if post.post.thumbnail_url}
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img
|
||||
src={bestImageURL(post.post, true)}
|
||||
loading="lazy"
|
||||
class="object-cover bg-slate-100 rounded-md h-24 w-24 border border-slate-200 dark:border-zinc-700"
|
||||
/>
|
||||
{/if}
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img
|
||||
src={bestImageURL(post.post, true)}
|
||||
loading="lazy"
|
||||
class="object-cover bg-slate-100 rounded-md h-24 w-24 border border-slate-200 dark:border-zinc-700"
|
||||
/>
|
||||
</a>
|
||||
{:else}
|
||||
<ExpandableImage url={bestImageURL(post.post, false, 2048)}>
|
||||
{#if post.post.thumbnail_url}
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img
|
||||
src={bestImageURL(post.post, true)}
|
||||
loading="lazy"
|
||||
class="object-cover bg-slate-100 rounded-md h-24 w-24 border border-slate-200 dark:border-zinc-700"
|
||||
/>
|
||||
{/if}
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img
|
||||
src={bestImageURL(post.post, true)}
|
||||
loading="lazy"
|
||||
class="object-cover bg-slate-100 rounded-md h-24 w-24 border border-slate-200 dark:border-zinc-700"
|
||||
/>
|
||||
</ExpandableImage>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user