misc: Fix overflow (hopefully)

This commit is contained in:
Xyphyn committed 2023-07-01 11:47:34 -07:00
1 parent 38d387e2c2
commit d6ed6fbab1
8 files changed
+70 -32

No files matched your search

+10 -7
View File
@@ -8,6 +8,7 @@
} from 'lemmy-js-client'
import type { CommentNodeI } from './comments.js'
import Comments from './Comments.svelte'
import SvelteMarkdown from 'svelte-markdown'
export let data: { post: GetPostResponse; comments: GetCommentsResponse }
@@ -81,12 +82,9 @@
return tree
}
let newComment = ''
async function comment() {}
</script>
<title>{data.post.post_view.post.name}</title>
<div class="flex flex-col gap-2">
<span class="flex flex-row gap-2 text-sm opacity-70">
<a href="/">c/{postData.community.name}</a>
@@ -94,13 +92,18 @@
</span>
<h1 class="font-bold text-lg">{post.name}</h1>
{#if post.thumbnail_url}
<img src={post.thumbnail_url} alt={post.name} />
<img
src={post.thumbnail_url}
alt={post.name}
class="rounded-md max-w-xl mx-auto"
/>
{/if}
{#if post.body}
<p
class="bg-slate-100 border border-slate-200 dark:border-zinc-800 dark:bg-zinc-900 p-2 text-sm rounded-md"
class="bg-slate-100 border border-slate-200 dark:border-zinc-800
dark:bg-zinc-900 p-2 text-sm rounded-md"
>
{post.body}
<SvelteMarkdown source={post.body} />
</p>
{/if}
</div>
+1 -1
View File
@@ -5,4 +5,4 @@
export let width: number
</script>
<img src={url} {alt} {width} class="rounded-full" />
<img src={url} {alt} {width} class="rounded-full aspect-square object-cover" />
+2 -1
View File
@@ -6,10 +6,11 @@
import RelativeDate from '$lib/components/RelativeDate.svelte'
export let node: CommentNodeI
export let open = true
</script>
<li class="py-2">
<details open class="flex flex-col gap-1">
<details {open} class="flex flex-col gap-1">
<summary class="flex flex-row cursor-pointer arrow gap-2 items-center">
<Avatar
url={node.comment_view.creator.avatar ??
+1 -1
View File
@@ -14,7 +14,7 @@
: 'ml-2 mx-2.5 px-2.5 border-l-2 border-black/10 dark:border-white/10'}
>
{#each nodes.slice(0, maxComments) as node}
<Comment {node} />
<Comment {node} open={true} />
{#if node.children?.length > 0}
<svelte:self nodes={node.children} isParent={false} />
{/if}
+7 -9
View File
@@ -18,8 +18,6 @@
let postRes: PostView
export { postRes as post }
const post = postRes.post
</script>
<div
@@ -34,19 +32,19 @@
<RelativeDate date={new Date(postRes.post.published)} />
</span>
</span>
<h1 class="font-bold text-lg">{post.name}</h1>
{#if post.url}
<h1 class="font-bold text-lg">{postRes.post.name}</h1>
{#if postRes.post.url}
<a
href={post.url}
href={postRes.post.url}
class="text-sky-400 max-w-[24ch] overflow-hidden
whitespace-nowrap text-ellipsis text-xs hover:underline"
>
{post.url}
{postRes.post.url}
</a>
{/if}
{#if post.body}
{#if postRes.post.body}
<p class="text-sm max-h-24 line-clamp-3">
{post.body}
{postRes.post.body}
</p>
{/if}
</div>
@@ -67,7 +65,7 @@
<a
class="flex flex-row items-center gap-2.5 p-1 px-2 rounded-md
bg-slate-100 dark:bg-zinc-800"
href="/post/{post.id}"
href="/post/{postRes.post.id}"
>
<Icon src={ChatBubbleLeft} width={16} height={16} />
<span class="text-sm">{postRes.counts.comments}</span>