feat: switch from card to material

This commit is contained in:
Xyphyn committed 2023-09-04 11:27:19 -07:00
1 parent 43b0e87ebf
commit c53ec52d86
16 files changed
+61 -126

No files matched your search

+6 -13
View File
@@ -1,13 +1,12 @@
<script lang="ts">
import type { PostView } from 'lemmy-js-client'
import { isImage } from '$lib/ui/image.js'
import Card from '$lib/components/ui/Card.svelte'
import { getInstance } from '$lib/lemmy.js'
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
import { userSettings } from '$lib/settings.js'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { toast } from 'mono-svelte'
import { Material, toast } from 'mono-svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
export let post: PostView
@@ -18,7 +17,9 @@
let loaded = false
</script>
<Card
<Material
color="distinct"
padding="none"
class="flex flex-col max-w-full min-w-0 w-full gap-2.5 {compact
? '!bg-transparent !border-0 py-5'
: 'p-5'}"
@@ -42,7 +43,7 @@
/>
<a
href="/post/{getInstance()}/{post.post.id}"
class="font-medium max-w-full w-full break-words"
class="font-medium max-w-full w-full break-words text-base"
style="word-break: break-word;"
class:text-slate-500={post.read && $userSettings.markReadPosts}
class:dark:text-zinc-400={post.read && $userSettings.markReadPosts}
@@ -51,14 +52,6 @@
</a>
</div>
{#if !$userSettings.showCompactPosts}
{#if post.post.url && !post.post.thumbnail_url}
<a
href={post.post.url}
class="max-w-full overflow-hidden overflow-ellipsis whitespace-nowrap text-sky-400 hover:underline text-xs"
>
{post.post.url}
</a>
{/if}
{#if isImage(post.post.url)}
<!--disabled preloads here since most people will hover over every image while scrolling-->
<a
@@ -153,4 +146,4 @@
/>
</div>
{/if}
</Card>
</Material>