fix: Add search button

This commit is contained in:
Xyphyn committed 2023-07-26 11:43:37 -07:00
1 parent 1dd179d636
commit bb8818b17b
1 file changed
+25 -10
+25 -10
View File
@@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import Button from '$lib/components/input/Button.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import TextInput from '$lib/components/input/TextInput.svelte' import TextInput from '$lib/components/input/TextInput.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte' import Comment from '$lib/components/lemmy/comment/Comment.svelte'
@@ -53,16 +54,30 @@
}) })
}} }}
/> />
<TextInput <div class="flex flex-row gap-2 items-center">
bind:value={query} <TextInput
placeholder="Search for something..." bind:value={query}
on:change={() => { placeholder="Search for something..."
$page.url.searchParams.set('q', query) on:change={() => {
goto($page.url.toString(), { $page.url.searchParams.set('q', query)
invalidateAll: true, goto($page.url.toString(), {
}) invalidateAll: true,
}} })
/> }}
/>
<Button
on:click={() => {
$page.url.searchParams.set('q', query)
goto($page.url.toString(), {
invalidateAll: true,
})
}}
size="lg"
class="h-full"
>
Search
</Button>
</div>
</div> </div>
{#if !data.results} {#if !data.results}
<div <div