From 74b03c33ff37d7363721bc2c33abb867dc9ea87c Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 14 Mar 2021 23:10:01 +0100 Subject: Add components to view topics and posts --- src/components/topic/topic.svelte | 95 +++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 54 deletions(-) (limited to 'src/components/topic') diff --git a/src/components/topic/topic.svelte b/src/components/topic/topic.svelte index 2aff79a..9be7346 100644 --- a/src/components/topic/topic.svelte +++ b/src/components/topic/topic.svelte @@ -1,59 +1,46 @@ + import ErrorBlock from '$/components/error_block/error_block.svelte'; + import Loader from '$/components/loader/loader.svelte'; + import PostContent from '$/components/post_content/post_content.svelte'; + import { readableTime } from '$/utils/readable_time.js'; -
-

This is a post in the forum.

- - - -
-

This is a main topic in the forum. Does that abstraction still even make sense?

-

Is this really it??

-

This might all be fake but at least the links look purple when visited

-
-
- -
-

It's just how it is...

-
-
-
+ $: store = getTopic(id); + $: topic = $store.data; + $: remainingTime = topic ? (topic.updated_at + topic.ttl) - Date.now() : 0; + $: remaining = readableTime(remainingTime); + - +{#if $store.loading} + +{/if} +{#if $store.error} + +{/if} +{#if topic} +
+

{topic.title}

+ + {#if topic.tags.length > 0} + + {/if} + {#each topic.posts as post, index} + + {/each} +
+{/if} -- cgit