im dying inside

This commit is contained in:
Xyphyn committed 2023-06-24 13:00:09 -07:00
1 parent 061c7d6766
commit c9fc488ef2
20 files changed
+716 -10

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
<script lang="ts">
import Navbar from '$lib/components/Navbar.svelte'
import '../style/app.css'
import { navigating, page } from '$app/stores'
import nProgress from 'nprogress'
import 'nprogress/nprogress.css'
nProgress.configure({
minimum: 0.4,
trickleSpeed: 200,
showSpinner: false,
})
$: {
if ($navigating) {
nProgress.start()
}
if (!$navigating) {
nProgress.done()
}
}
</script>
<Navbar routes={$page.url.pathname.split('/').slice(2)} />
<div class="mx-auto max-w-7xl p-4">
<slot />
</div>
+10 -2
View File
@@ -1,2 +1,10 @@
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
<script lang="ts">
import Link from '$lib/components/Link.svelte'
let community = ''
</script>
<input bind:value={community} placeholder="Community name" />
<div class="w-max">
<Link href="/c/{community}">Go</Link>
</div>
+6
View File
@@ -0,0 +1,6 @@
import { lemmy } from '$lib/lemmy.js';
import { error } from '@sveltejs/kit';
export function load({ params }) {
return lemmy.getCommunity({ name: params.name })
}
+23
View File
@@ -0,0 +1,23 @@
<script lang="ts">
import type { GetCommunityResponse } from 'lemmy-js-client'
export let data: Promise<GetCommunityResponse>
</script>
{#await data then data}
<div class="flex flex-col gap-4">
<div class="flex flex-row gap-4 items-center">
<img
src={data.community_view.community.icon}
alt="test"
class="rounded-full bg-white border-slate-200 border p-2"
width={64}
height={64}
/>
<h1 class="font-bold text-xl">
{data.community_view.community.name}
</h1>
</div>
<slot />
</div>
{/await}
View File
Whitespace-only changes.
@@ -0,0 +1,5 @@
import { lemmy } from '$lib/lemmy.js';
export function load({ params }) {
return lemmy.getPosts({ limit: 20, community_name: params.name, page: 1, })
}
+18
View File
@@ -0,0 +1,18 @@
<script lang="ts">
import MultiSelect from '$lib/components/MultiSelect.svelte'
import type { PostResponse } from 'lemmy-js-client'
import Post from './Post.svelte'
export let data: any
</script>
<MultiSelect options={['Community', 'idk']} selected="Community" />
<div class="flex flex-col gap-4">
{#await data then data}
<pre>{JSON.stringify(data, undefined, 2)}</pre>
{#each data?.posts as post}
<Post {post} />
{/each}
{/await}
</div>
+5
View File
@@ -0,0 +1,5 @@
<script lang="ts">
export let post: Post
</script>
<p>{post.post.name}</p>