Move routes around, tweak navigation, fix CardButton

This commit is contained in:
Jon Staab
2024-10-21 13:18:48 -07:00
parent b1a8ddf68c
commit dea34f96ec
20 changed files with 149 additions and 130 deletions
+40
View File
@@ -0,0 +1,40 @@
<script lang="ts">
import {onMount} from "svelte"
import {createScroller} from "@lib/html"
import {profileSearch} from "@welshman/app"
import Icon from "@lib/components/Icon.svelte"
import Page from "@lib/components/Page.svelte"
import PeopleItem from "@app/components/PeopleItem.svelte"
import {getDefaultPubkeys} from "@app/state"
const defaultPubkeys = getDefaultPubkeys()
let term = ""
let limit = 10
let element: Element
$: pubkeys = term ? $profileSearch.searchValues(term) : defaultPubkeys
onMount(() => {
const scroller = createScroller({
element,
onScroll: () => {
limit += 10
},
})
return () => scroller.stop()
})
</script>
<Page>
<div class="content col-2" bind:this={element}>
<label class="input input-bordered flex w-full items-center gap-2">
<Icon icon="magnifer" />
<input bind:value={term} class="grow" type="text" placeholder="Search for people..." />
</label>
{#each pubkeys.slice(0, limit) as pubkey (pubkey)}
<PeopleItem {pubkey} />
{/each}
</div>
</Page>