misc: use native forms for sort/location
This commit is contained in:
1 parent
2540536773
commit
ee08787afc
2 files changed
+18
-5
No files matched your search
@@ -70,6 +70,7 @@
|
|||||||
customLabel,
|
customLabel,
|
||||||
children,
|
children,
|
||||||
customOption,
|
customOption,
|
||||||
|
...rest
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -84,6 +85,7 @@
|
|||||||
<Menu bind:open>
|
<Menu bind:open>
|
||||||
{#snippet target()}
|
{#snippet target()}
|
||||||
<select
|
<select
|
||||||
|
{...rest}
|
||||||
{id}
|
{id}
|
||||||
bind:this={element}
|
bind:this={element}
|
||||||
class="{buttonSize[size]} {buttonShadow[
|
class="{buttonSize[size]} {buttonShadow[
|
||||||
|
|||||||
+16
-5
@@ -4,7 +4,7 @@
|
|||||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||||
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
|
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
|
||||||
import { searchParam } from '$lib/util.svelte.js'
|
import { searchParam } from '$lib/util.svelte.js'
|
||||||
import { ChartBar, Icon } from 'svelte-hero-icons'
|
import { ArrowRight, ChartBar, Icon } from 'svelte-hero-icons'
|
||||||
import { site } from '$lib/lemmy.js'
|
import { site } from '$lib/lemmy.js'
|
||||||
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
|
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
||||||
import type { ListingType } from 'lemmy-js-client'
|
import type { ListingType } from 'lemmy-js-client'
|
||||||
import { get } from 'svelte/store'
|
import { get } from 'svelte/store'
|
||||||
|
import Button from 'mono-svelte/button/Button.svelte'
|
||||||
|
|
||||||
let { data = $bindable() } = $props()
|
let { data = $bindable() } = $props()
|
||||||
|
|
||||||
@@ -39,13 +40,23 @@
|
|||||||
{$t('routes.frontpage.title')}
|
{$t('routes.frontpage.title')}
|
||||||
|
|
||||||
{#snippet extended()}
|
{#snippet extended()}
|
||||||
<div class="flex items-center gap-2">
|
<form class="flex items-center gap-2" method="get" action="/">
|
||||||
{#if type}
|
{#if type}
|
||||||
<Location navigate bind:selected={type} />
|
<Location name="type" navigate bind:selected={type} />
|
||||||
{/if}
|
{/if}
|
||||||
<Sort navigate bind:selected={sort} />
|
<Sort name="sort" navigate bind:selected={sort} />
|
||||||
<ViewSelect />
|
<ViewSelect />
|
||||||
</div>
|
|
||||||
|
<noscript>
|
||||||
|
<Button
|
||||||
|
class="self-end h-[34px] aspect-square"
|
||||||
|
size="custom"
|
||||||
|
submit
|
||||||
|
>
|
||||||
|
<Icon src={ArrowRight} size="16" micro />
|
||||||
|
</Button>
|
||||||
|
</noscript>
|
||||||
|
</form>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Header>
|
</Header>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in new issue
Block a user