Fix thread page styling

This commit is contained in:
Jon Staab
2026-06-24 11:19:13 -07:00
parent 09adf33333
commit 1eb75f4ae7
4 changed files with 34 additions and 30 deletions
+16 -16
View File
@@ -2,6 +2,7 @@
import {formatTimestamp, max} from "@welshman/lib"
import type {TrustedEvent} from "@welshman/util"
import {COMMENT, getTagValue} from "@welshman/util"
import {goto} from "$app/navigation"
import Link from "@lib/components/Link.svelte"
import ProfileCircle from "@app/components/ProfileCircle.svelte"
import ProfileName from "@app/components/ProfileName.svelte"
@@ -20,29 +21,28 @@
const replyCount = $derived($replies.length)
const lastActive = $derived(max([...$replies, event].map(e => e.created_at)))
const title = getTagValue("title", event.tags)
const path = makeThreadPath(url, event.id)
const goToThread = () => goto(path)
</script>
<tr>
<td>
<Link href={makeThreadPath(url, event.id)}>
<p class="ellipsize text-sm font-bold sm:text-base">{title || "Untitled thread"}</p>
<p class="ellipsize mt-0.5 text-xs opacity-60 sm:hidden">
by <ProfileName pubkey={event.pubkey} {url} />
</p>
<tr class="cursor-pointer hover:bg-base-200/40 text-sm" onclick={goToThread}>
<td class="px-4 py-2 align-top">
<Link href={path} class="ellipsize font-semibold">
{title || "Untitled thread"}
</Link>
</td>
<td>
<ProfileCircle pubkey={event.pubkey} {url} size={6} />
<span class="ellipsize text-sm">
<ProfileName pubkey={event.pubkey} {url} />
</span>
<td class="px-4 py-2 align-middle">
<div class="flex items-center gap-2">
<ProfileCircle pubkey={event.pubkey} {url} size={5} />
<span class="ellipsize">
<ProfileName pubkey={event.pubkey} {url} />
</span>
</div>
</td>
<td>
<span class="opacity-60 sm:hidden">Replies · </span>
<td class="px-4 py-2 align-middle text-right">
{replyCount}
</td>
<td>
<span class="opacity-60 sm:hidden">Last · </span>
<td class="whitespace-nowrap px-4 py-2 align-middle text-right">
{formatTimestamp(lastActive)}
</td>
</tr>