stage3: add inbox/search/comment methods

This commit is contained in:
James Xylight committed 2025-09-04 18:13:03 -07:00
1 parent d236912510
commit f177fab454
8 files changed
+469 -203

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@
function getError(message: string): { string: string; code: boolean } {
try {
return { string: errorMessage(JSON.parse(message)), code: false }
return { string: errorMessage(message), code: false }
} catch {
return { string: message, code: true }
}
@@ -18,7 +18,7 @@
class="flex flex-col gap-4 my-auto h-full justify-center max-w-md w-full mx-auto"
>
<h1
class="text-primary-900 dark:text-primary-100 text-6xl font-black flex items-center flex-row gap-2 border-b pb-4 border-slate-200 dark:border-zinc-800 font-mono"
class="text-primary-900 dark:text-primary-100 text-6xl font-black flex items-center flex-row gap-2 font-mono"
>
{page.status}
</h1>
+8 -2
View File
@@ -33,6 +33,7 @@
import { expoOut } from 'svelte/easing'
import { fly, slide } from 'svelte/transition'
import SearchBar from './SearchBar.svelte'
import { client } from '$lib/client/lemmy.svelte'
let { data } = $props()
@@ -55,6 +56,7 @@
<Header pageHeader>
{$t('routes.search.title')}
{#snippet extended()}
{@const clientType = client().type.name}
<form method="get" action="/search" class="contents" bind:this={form}>
<SearchBar bind:query={data.filters.value.query} />
<div class="flex flex-row flex-wrap items-center gap-4">
@@ -69,9 +71,13 @@
{$t('filter.type')}
</span>
{/snippet}
<Option value="All">{$t('content.all')}</Option>
{#if clientType == 'lemmy'}
<Option value="All">{$t('content.all')}</Option>
{/if}
<Option value="Posts">{$t('content.posts')}</Option>
<Option value="Comments">{$t('content.comments')}</Option>
{#if clientType == 'lemmy'}
<Option value="Comments">{$t('content.comments')}</Option>
{/if}
<Option value="Communities">{$t('content.communities')}</Option>
<Option value="Users">{$t('content.users')}</Option>
<Option value="Url">{$t('content.url')}</Option>
+3 -1
View File
@@ -21,7 +21,9 @@ export async function load({ url, fetch }) {
page: page,
sort: (sort as SortType) || 'TopAll',
listing_type: listing_type,
type_: (type as SearchType) ?? 'All',
type_:
(type as SearchType) ??
(client().type.name == 'lemmy' ? 'All' : 'Posts'),
})
const [posts, comments, users, communities] = [