add comment section stub

This commit is contained in:
Yusur 2025-10-23 15:43:00 +02:00
parent da1c2809d9
commit 599075219f
5 changed files with 31 additions and 6 deletions

View file

@ -0,0 +1,16 @@
<script lang="ts">
import type { CommentEntry } from "./backend";
import Centered from "./Centered.svelte";
let comments: null | CommentEntry = $state(null);
let { post } = $props();
</script>
{#if comments === null}
<Centered>
<button class="inline">Show comments</button>
</Centered>
{/if}

View file

@ -28,7 +28,7 @@ let { id, title, content = "", votes, my_vote, comment_count } = post;
<style>
.post-frame {
padding-left: 2em;
padding-inline-start: 2em;
position: relative;
}
.message-stats {

View file

@ -13,6 +13,7 @@
import VoteButton from "./VoteButton.svelte";
import { getMe } from "./globals.svelte";
import CommentCount from "./CommentCount.svelte";
import CommentSection from "./CommentSection.svelte";
@ -51,7 +52,7 @@ let { title, id, content = '', to, votes, my_vote, comment_count } = post;
</div>
</article>
<CommentSection {post} />
{#snippet left()}
{#if to.type === 'guild'}
@ -78,13 +79,13 @@ let { title, id, content = '', to, votes, my_vote, comment_count } = post;
overflow-x: auto;
}
.post-body {
margin-inline-start: 3em;
margin-inline-start: 2em;
}
.message-stats {
position: absolute;
inset-inline-start: 0;
top: 0;
width: 3em;
width: 2em;
display: flex;
flex-direction: column;
justify-content: flex-start;

View file

@ -9,7 +9,6 @@ let { guild }: { guild: GuildEntry } = $props();
</script>
{#if guild}
<AsideCard title={'About ' + (guild.display_name? `${guild.display_name} (+${guild.name})`: `+${guild.name}`)}>
<ul>
@ -21,4 +20,4 @@ let { guild }: { guild: GuildEntry } = $props();
{/if}
</ul>
</AsideCard>
{/if}
{/if}

View file

@ -37,6 +37,15 @@ export type PostEntry = {
comment_count?: number | null
};
export type CommentEntry = {
id: string,
parent?: {id: string},
locked?: boolean,
removed?: number | true,
content?: string,
created_at: string
};
export type ServerHealth = {
version: string,
name: string,