feat: Add instance info

This commit is contained in:
Xyphyn committed 2023-07-02 15:04:10 -07:00
1 parent 3159583654
commit 4b23c98dbd
11 files changed
+189 -68

No files matched your search

+3 -2
View File
@@ -10,6 +10,7 @@
import Comments from './Comments.svelte'
import SvelteMarkdown from 'svelte-markdown'
import CommunityLink from '$lib/components/CommunityLink.svelte'
import { isImage } from '$lib/ui/image.js'
export let data: { post: GetPostResponse; comments: GetCommentsResponse }
@@ -101,9 +102,9 @@
{post.url}
</a>
{/if}
{#if post.thumbnail_url}
{#if isImage(post.url)}
<img
src={post.thumbnail_url}
src={post.url}
alt={post.name}
class="rounded-md max-w-screen max-h-[80vh] mx-auto"
/>
+22 -1
View File
@@ -13,7 +13,9 @@
<li class="py-3">
<details bind:open class="flex flex-col gap-1">
<summary class="flex flex-row cursor-pointer arrow gap-2 items-center">
<summary
class="flex flex-row cursor-pointer arrow gap-2 items-center group"
>
<Avatar
url={node.comment_view.creator.avatar ??
`https://api.dicebear.com/6.x/initials/svg?seed=${node.comment_view.creator.name}`}
@@ -29,6 +31,25 @@
<span class="text-sm opacity-60">
<RelativeDate date={new Date(node.comment_view.comment.published)} />
</span>
<span
class="ml-auto translate-x-1 opacity-0
group-hover:translate-x-0 group-hover:opacity-100 text-xs transition-all
flex flex-row items-center gap-1 hover:dark:bg-white/10 p-1 rounded-md
hover:bg-black/10 px-2"
>
{#if open}
<div class="inline">
<Icon src={Minus} width={16} height={16} mini />
</div>
Collapse
{:else}
<Icon src={Plus} width={16} height={16} mini />
Expand
{#if node.children.length > 0}
<span class="text-xs opacity-50">+{node.children.length}</span>
{/if}
{/if}
</span>
</summary>
<div class="mt-1">
<div
+9 -5
View File
@@ -9,6 +9,8 @@
ArrowDown,
ArrowUp,
ChatBubbleLeft,
ChatBubbleOvalLeft,
ChatBubbleOvalLeftEllipsis,
ChevronDown,
ChevronUp,
Icon,
@@ -65,7 +67,8 @@
<div class="flex flex-row gap-2 p-2">
<div
class="flex flex-row items-center gap-1 rounded-md
bg-slate-100 dark:bg-zinc-800"
bg-slate-100 dark:bg-zinc-800 hover:bg-slate-200
dark:hover:bg-zinc-700 transition-colors cursor-pointer"
>
<button aria-label="Upvote" class="p-1 px-1.5">
<Icon src={ChevronUp} mini width={20} height={20} />
@@ -76,16 +79,17 @@
)}
</span>
<button aria-label="Downvote" class="p-1 px-1.5">
<Icon src={ChevronDown} mini width={20} height="20}" />
<Icon src={ChevronDown} mini width={20} height={20} />
</button>
</div>
<a
class="flex flex-row items-center gap-2.5 p-1 px-2 rounded-md
bg-slate-100 dark:bg-zinc-800"
class="flex flex-row items-center gap-1 p-1.5 px-3 rounded-md
bg-slate-100 dark:bg-zinc-800 hover:bg-slate-200
dark:hover:bg-zinc-700 transition-colors"
href="/post/{postRes.post.id}"
>
<Icon src={ChatBubbleLeft} width={16} height={16} />
<Icon src={ChatBubbleOvalLeft} mini width={16} height={16} />
<span class="text-sm">
{Intl.NumberFormat('en', { notation: 'compact' }).format(
postRes.counts.comments