Lint/format

This commit is contained in:
Jon Staab
2024-10-18 16:09:17 -07:00
parent b79a274944
commit 8bb2a12a2d
10 changed files with 41 additions and 50 deletions
+2 -2
View File
@@ -26,8 +26,8 @@
})
</script>
<div class="column max-h-full content-t" bind:this={element}>
<div class="flex-grow content-x">
<div class="column content-t max-h-full" bind:this={element}>
<div class="content-x flex-grow">
<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..." />
+9 -11
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import {nip19} from 'nostr-tools'
import {nip19} from "nostr-tools"
import {hexToBytes} from "@noble/hashes/utils"
import {ctx} from "@welshman/lib"
import {
@@ -91,7 +91,7 @@
{/key}
</div>
{#if editing}
<form class="card2 bg-alt shadow-xl col-4" transition:slide on:submit|preventDefault={saveEdit}>
<form class="card2 bg-alt col-4 shadow-xl" transition:slide on:submit|preventDefault={saveEdit}>
<div class="flex justify-center py-2">
<InputProfilePicture bind:file bind:url={values.picture} />
</div>
@@ -128,7 +128,7 @@
</form>
{/if}
{#if $session?.method === "nip01"}
<div class="card2 bg-alt shadow-xl col-4" transition:slide>
<div class="card2 bg-alt col-4 shadow-xl" transition:slide>
<FieldInline>
<p slot="label">Public Key</p>
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
@@ -139,10 +139,10 @@
</Button>
</label>
<p slot="info">
Your public key is your nostr user identifier. It also allows other people to
authenticate your messages.
<p>
</FieldInline>
Your public key is your nostr user identifier. It also allows other people to authenticate
your messages.
</p>
<p></p></FieldInline>
<FieldInline>
<p slot="label">Private Key</p>
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
@@ -152,10 +152,8 @@
<Icon icon="copy" />
</Button>
</label>
<p slot="info">
Your private key is your nostr password. Keep this somewhere safe!
<p>
</FieldInline>
<p slot="info">Your private key is your nostr password. Keep this somewhere safe!</p>
<p></p></FieldInline>
</div>
{/if}
</div>
@@ -1,7 +1,7 @@
<script lang="ts">
import {onMount} from "svelte"
import {page} from "$app/stores"
import {sortBy, tryCatch, last, ago} from "@welshman/lib"
import {sortBy, last, ago} from "@welshman/lib"
import type {TrustedEvent} from "@welshman/util"
import {EVENT_DATE, EVENT_TIME} from "@welshman/util"
import {subscribe, formatTimestampAsDate} from "@welshman/app"
@@ -21,8 +21,7 @@
const createEvent = () => pushModal(EventCreate, {url})
const getEnd = (event: TrustedEvent) =>
parseInt(event.tags.find(t => t[0] === "end")?.[1] || "")
const getEnd = (event: TrustedEvent) => parseInt(event.tags.find(t => t[0] === "end")?.[1] || "")
const getStart = (event: TrustedEvent) =>
parseInt(event.tags.find(t => t[0] === "start")?.[1] || "")
@@ -35,19 +34,21 @@
dateDisplay?: string
}
$: items = sortBy(e => -getStart(e), $events).reduce<Item[]>((r, event) => {
const end = getEnd(event)
const start = getStart(event)
$: items = sortBy(e => -getStart(e), $events)
.reduce<Item[]>((r, event) => {
const end = getEnd(event)
const start = getStart(event)
if (isNaN(start) || isNaN(end)) return r
if (isNaN(start) || isNaN(end)) return r
const prevDateDisplay =
r.length > 0 ? formatTimestampAsDate(getStart(last(r).event)) : undefined
const newDateDisplay = formatTimestampAsDate(start)
const dateDisplay = prevDateDisplay === newDateDisplay ? undefined : newDateDisplay
const prevDateDisplay =
r.length > 0 ? formatTimestampAsDate(getStart(last(r).event)) : undefined
const newDateDisplay = formatTimestampAsDate(start)
const dateDisplay = prevDateDisplay === newDateDisplay ? undefined : newDateDisplay
return [...r, {event, dateDisplay}]
}, []).slice(0, limit)
return [...r, {event, dateDisplay}]
}, [])
.slice(0, limit)
onMount(() => {
const sub = subscribe({filters: [{kinds, since: ago(30)}]})