fix: compact posts not grid
This commit is contained in:
1 parent
e8592b24ca
commit
6fa45483fa
1 file changed
+20
-4
@@ -6,7 +6,7 @@
|
|||||||
import { userSettings } from '$lib/settings.js'
|
import { userSettings } from '$lib/settings.js'
|
||||||
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
|
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
|
||||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||||
import { Material, toast } from 'mono-svelte'
|
import { Badge, Material, toast } from 'mono-svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
||||||
import {
|
import {
|
||||||
@@ -16,7 +16,12 @@
|
|||||||
} from '$lib/components/lemmy/post/helpers.js'
|
} from '$lib/components/lemmy/post/helpers.js'
|
||||||
import Empty from '$lib/components/helper/Empty.svelte'
|
import Empty from '$lib/components/helper/Empty.svelte'
|
||||||
import { publishedToDate } from '$lib/components/util/date.js'
|
import { publishedToDate } from '$lib/components/util/date.js'
|
||||||
import { Icon, VideoCamera } from 'svelte-hero-icons'
|
import {
|
||||||
|
ArrowUp,
|
||||||
|
ChatBubbleOvalLeft,
|
||||||
|
Icon,
|
||||||
|
VideoCamera,
|
||||||
|
} from 'svelte-hero-icons'
|
||||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||||
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
|
||||||
import PostBody from './PostBody.svelte'
|
import PostBody from './PostBody.svelte'
|
||||||
@@ -43,12 +48,12 @@
|
|||||||
<Material
|
<Material
|
||||||
color={view != 'card' ? 'none' : 'distinct'}
|
color={view != 'card' ? 'none' : 'distinct'}
|
||||||
padding="none"
|
padding="none"
|
||||||
class="relative max-w-full min-w-0 w-full test group gap-2 flex flex-col
|
class="relative max-w-full min-w-0 w-full test group gap-2
|
||||||
{view != 'card' ? 'bg-transparent !border-0' : 'p-5'} {view == 'compact'
|
{view != 'card' ? 'bg-transparent !border-0' : 'p-5'} {view == 'compact'
|
||||||
? 'py-4 list-type'
|
? 'py-4 list-type'
|
||||||
: view == 'list'
|
: view == 'list'
|
||||||
? 'py-5 list-type'
|
? 'py-5 list-type'
|
||||||
: 'py-5'} {$$props.class}"
|
: 'py-5 flex flex-col'} {$$props.class}"
|
||||||
id={post.post.id}
|
id={post.post.id}
|
||||||
>
|
>
|
||||||
<PostMeta
|
<PostMeta
|
||||||
@@ -100,6 +105,17 @@
|
|||||||
}}
|
}}
|
||||||
style="grid-area: actions;"
|
style="grid-area: actions;"
|
||||||
/>
|
/>
|
||||||
|
{:else if view == 'compact'}
|
||||||
|
<div class="flex flex-row items-center gap-2 text-sm">
|
||||||
|
<Badge>
|
||||||
|
<Icon src={ArrowUp} slot="icon" size="14" micro />
|
||||||
|
{post.counts.score}
|
||||||
|
</Badge>
|
||||||
|
<Badge>
|
||||||
|
<Icon src={ChatBubbleOvalLeft} slot="icon" size="14" micro />
|
||||||
|
{post.counts.comments}
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</Material>
|
</Material>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user