sanifae/src/routes/+page.svelte

23 lines
661 B
Svelte
Raw Normal View History

2023-01-30 16:17:58 -05:00
<script>
2023-02-05 09:47:26 -05:00
import Post from '$lib/components/Post.svelte';
2023-02-10 20:08:34 -05:00
import Button from '$lib/components/Button.svelte'
2023-02-01 19:22:43 -05:00
/** @type {import('./$types').PageData} */
export let data;
2023-01-30 16:17:58 -05:00
</script>
2023-02-03 21:54:01 -05:00
{#each data.postJson.data as post}
2023-02-01 19:22:43 -05:00
<Post
success={post.success}
username={post.username}
content={post.content}
upvotes={post.upvotes}
downvotes={post.downvotes}
id={post.id}
></Post>
{/each}
<p>
2023-02-10 20:08:34 -05:00
<Button clickFunc={() => { window.location.search = 'page=' + ((data.id)-1) }}>Previous page</Button>
<Button clickFunc={() => { window.location.search = 'page=' + ((data.id)+1) }}>Next page</Button>
</p>