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

@@ -1,15 +1,14 @@
<script lang="ts">
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import Card from '$lib/components/ui/Card.svelte'
import { getInstance } from '$lib/lemmy.js'
import type { CommentView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Button, Material } from 'mono-svelte'
export let comment: CommentView
</script>
<Card class="flex flex-col bg-white rounded-md p-5 flex-1 gap-1">
<Material class="flex flex-col flex-1 gap-1" color="distinct" padding="lg">
<div class="flex flex-row justify-between items-center">
<PostMeta
community={comment.community}
@@ -42,4 +41,4 @@
replying={false}
/>
</div>
</Card>
</Material>
@@ -3,7 +3,6 @@
import { amMod } from '$lib/components/lemmy/moderation/moderation.js'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
import Card from '$lib/components/ui/Card.svelte'
import StickyCard from '$lib/components/ui/StickyCard.svelte'
import { toast } from 'mono-svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
+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>