Accounts component
This commit is contained in:
parent
8bf166f134
commit
fe96164f4e
4 changed files with 85 additions and 21 deletions
|
@ -1,19 +1,35 @@
|
|||
<script lang="ts">
|
||||
import PostComponent from "./lib/PostComponent.svelte";
|
||||
import { fetchAllPosts, Post } from "./lib/pdsfetch";
|
||||
import AccountComponent from "./lib/AccountComponent.svelte";
|
||||
import { fetchAllPosts, Post, getAllMetadataFromPds } from "./lib/pdsfetch";
|
||||
const postsPromise = fetchAllPosts();
|
||||
const accountsPromise = getAllMetadataFromPds();
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<h1>Welcome to the Feed</h1>
|
||||
{#await accountsPromise}
|
||||
<p>Loading...</p>
|
||||
{:then accountsData}
|
||||
<div id="Account">
|
||||
{#each accountsData as accountObject}
|
||||
<AccountComponent account={accountObject} />
|
||||
{/each}
|
||||
</div>
|
||||
{:catch error}
|
||||
<p>Error: {error.message}</p>
|
||||
{/await}
|
||||
|
||||
{#await postsPromise}
|
||||
<p>Loading...</p>
|
||||
{:then postsData}
|
||||
{#each postsData as postObject}
|
||||
<PostComponent post={postObject as Post} />
|
||||
{/each}
|
||||
<div id="Feed">
|
||||
{#each postsData as postObject}
|
||||
<PostComponent post={postObject as Post} />
|
||||
{/each}
|
||||
</div>
|
||||
{/await}
|
||||
</main>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue