From: Ruben Beltran del Rio Date: Sun, 14 Mar 2021 22:07:13 +0000 (+0100) Subject: Add post content component X-Git-Url: https://git.r.bdr.sh/rbdr/forum/commitdiff_plain/c458f2733c730cc174500ba308e3a670057d4d84?hp=b86d428a969f761c2270c04d15c7528bb398111a Add post content component --- diff --git a/src/components/post/post.svelte b/src/components/post/post.svelte index 4720533..bf2a190 100644 --- a/src/components/post/post.svelte +++ b/src/components/post/post.svelte @@ -1,27 +1,23 @@ + import { getPost } from '$/stores/post'; + import PostContent from '$/components/post_content/post_content.svelte'; + import ErrorBlock from '$/components/error_block/error_block.svelte'; + import Loader from '$/components/loader/loader.svelte'; - -
-

It's just how it is...

-
-
+ $: store = getPost(id); + $: post = $store.data; + - +{#if $store.loading} + +{/if} +{#if $store.error} + +{/if} +{#if post} + +{/if} diff --git a/src/components/post_content/post_content.svelte b/src/components/post_content/post_content.svelte new file mode 100644 index 0000000..671c07c --- /dev/null +++ b/src/components/post_content/post_content.svelte @@ -0,0 +1,40 @@ + + +
+ {post.text} +
+
+ +