feat: Add post uploading

This commit is contained in:
Xyphyn committed 2023-07-05 12:58:36 -07:00
1 parent 5f674d4691
commit 1842139af9
31 files changed
+560 -225

No files matched your search

+10 -12
View File
@@ -35,20 +35,18 @@
}}
/>
<div class="flex flex-col sm:flex-row gap-2 sm:ml-auto">
<TextInput
class="bg-slate-100 border border-slate-200 dark:border-zinc-800
dark:bg-zinc-900 rounded-md"
bind:value={search}
/>
<Link
href={(function () {
<TextInput class="rounded-md" bind:value={search} />
<Button
on:click={() => {
$page.url.searchParams.set('q', search)
return $page.url.toString()
})()}
goto($page.url.toString(), {
invalidateAll: true,
})
}}
color={Color.ghost}
>
Search
</Link>
</Button>
</div>
</div>
<ul class="flex flex-col">
@@ -92,11 +90,11 @@
</div>
</div>
{#if !community.community.local}
<span class="opacity-80">
<span class="opacity-80 mb-2">
{new URL(community.community.actor_id).hostname}
</span>
{/if}
<div class="flex flex-row gap-3 items-center mt-2">
<div class="flex flex-row gap-3 items-center">
<div class="flex flex-row gap-1 items-center">
<Icon src={UserGroup} width={16} mini />
<span>
+6 -3
View File
@@ -1,5 +1,6 @@
import { getClient } from '$lib/lemmy.js'
import { authData, getClient } from '$lib/lemmy.js'
import type { ListingType } from 'lemmy-js-client'
import { get } from 'svelte/store'
export function load({ url }) {
const type = url.searchParams.get('listingType') as ListingType
@@ -10,17 +11,19 @@ export function load({ url }) {
return getClient().search({
limit: 40,
page: page,
sort: 'Active',
sort: 'TopAll',
type_: 'Communities',
listing_type: type,
q: query,
auth: get(authData)?.token,
})
} else {
return getClient().listCommunities({
limit: 40,
page: page,
sort: 'Active',
sort: 'TopAll',
type_: type,
auth: get(authData)?.token,
})
}
}