|
1 | 1 | <script lang="ts">
|
2 |
| - import Quib from '$lib/components/pages/home/quib.svelte'; |
3 |
| - import QuibsHeader from '$lib/components/pages/home/quibs_header.svelte'; |
4 |
| - import RecentQuibs from '$lib/components/pages/home/recent_quibs.svelte'; |
| 2 | + import Quib from '$lib/components/quib.svelte'; |
| 3 | + import QuibsHeader from '$lib/components/quibs_header.svelte'; |
| 4 | + import recent_posts from '$lib/data/mock/recent_posts.json'; |
| 5 | + import readable from 'readable-numbers'; |
| 6 | + import Avatar from '$lib/components/ui/avatar.svelte'; |
5 | 7 | import type { PageData } from './$types';
|
6 | 8 |
|
7 | 9 | const { data }: { data: PageData } = $props();
|
|
25 | 27 | <div
|
26 | 28 | class="fixed top-[3.75rem] flex h-[calc(100dvh-3.75rem)] w-72 flex-col gap-4 overflow-y-scroll p-4 scrollbar-none"
|
27 | 29 | >
|
28 |
| - <RecentQuibs /> |
| 30 | + <h2 class="font-medium">Recent Quibs</h2> |
| 31 | + <div class="flex flex-col gap-4"> |
| 32 | + {#each recent_posts as post} |
| 33 | + <div class="flex flex-col gap-2"> |
| 34 | + <div class="flex justify-between gap-2"> |
| 35 | + <div class="flex flex-col gap-1"> |
| 36 | + <a |
| 37 | + href="/q/{post.community.name}" |
| 38 | + class="flex items-center gap-2 hover:text-accent hover:underline" |
| 39 | + > |
| 40 | + <Avatar src={post.community.avatar} /> |
| 41 | + <h3 class="text-xs font-semibold">q/{post.community.name}</h3> |
| 42 | + </a> |
| 43 | + <a |
| 44 | + href="/q/{post.community.name}/posts/{post.slug}" |
| 45 | + class="font-semibold text-info hover:underline" |
| 46 | + > |
| 47 | + {post.title} |
| 48 | + </a> |
| 49 | + </div> |
| 50 | + {#if post.cover} |
| 51 | + <img |
| 52 | + class="aspect-square size-20 flex-shrink-0 rounded-xl object-cover" |
| 53 | + src={post.cover} |
| 54 | + alt="" |
| 55 | + /> |
| 56 | + {/if} |
| 57 | + </div> |
| 58 | + <div class="flex items-center gap-2"> |
| 59 | + <p class="text-xs font-medium">{readable(post.likes)} upvotes</p> |
| 60 | + <coreicons-shape-circle variant="filled" class="size-0.5" |
| 61 | + ></coreicons-shape-circle> |
| 62 | + <p class="text-xs font-medium">{readable(post.comments)} comments</p> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + {/each} |
| 66 | + </div> |
29 | 67 | </div>
|
30 | 68 | </div>
|
0 commit comments