forked from coracle/flotilla
Lint/format
This commit is contained in:
@@ -36,7 +36,6 @@ import {
|
||||
getWriteRelayUrls,
|
||||
loadFollows,
|
||||
loadMutes,
|
||||
getFollows,
|
||||
tagEvent,
|
||||
tagReactionTo,
|
||||
getRelayUrls,
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from 'nostr-tools'
|
||||
import {ctx} from '@welshman/lib'
|
||||
import {nip19} from "nostr-tools"
|
||||
import {ctx} from "@welshman/lib"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import FieldInline from "@lib/components/FieldInline.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
||||
import {clip} from '@app/toast'
|
||||
import {clip} from "@app/toast"
|
||||
|
||||
export let event
|
||||
|
||||
const relays = ctx.app.router.Event(event).getUrls()
|
||||
const note1 = nip19.noteEncode(event.id)
|
||||
const npub1 = nip19.npubEncode(event.pubkey)
|
||||
const json = JSON.stringify(event, null, 2)
|
||||
@@ -27,7 +26,7 @@
|
||||
<p slot="label">Event ID</p>
|
||||
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
|
||||
<Icon icon="file" />
|
||||
<input type="text" class="grow ellipsize" value={note1} />
|
||||
<input type="text" class="ellipsize grow" value={note1} />
|
||||
<Button on:click={copyId} class="flex items-center">
|
||||
<Icon icon="copy" />
|
||||
</Button>
|
||||
@@ -37,7 +36,7 @@
|
||||
<p slot="label">Author Pubkey</p>
|
||||
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
|
||||
<Icon icon="user-circle" />
|
||||
<input type="text" class="grow ellipsize" value={npub1} />
|
||||
<input type="text" class="ellipsize grow" value={npub1} />
|
||||
<Button on:click={copyPubkey} class="flex items-center">
|
||||
<Icon icon="copy" />
|
||||
</Button>
|
||||
@@ -45,8 +44,8 @@
|
||||
</FieldInline>
|
||||
<div class="relative">
|
||||
<pre class="card2 card2-sm bg-alt overflow-auto"><code>{json}</code></pre>
|
||||
<p class="absolute right-2 top-2 flex justify-between items-center flex-grow">
|
||||
<Button on:click={copyJson} class="flex items-center btn btn-sm btn-neutral">
|
||||
<p class="absolute right-2 top-2 flex flex-grow items-center justify-between">
|
||||
<Button on:click={copyJson} class="btn btn-neutral btn-sm flex items-center">
|
||||
<Icon icon="copy" /> Copy
|
||||
</Button>
|
||||
</p>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {page} from "$app/stores"
|
||||
import {goto} from "$app/navigation"
|
||||
import {displayRelayUrl} from '@welshman/util'
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
@@ -28,7 +28,7 @@
|
||||
let space = $page.params?.nrelay ? decodeNRelay($page.params?.nrelay) : undefined
|
||||
let showSettings = false
|
||||
|
||||
const assertNotNil = <T>(x: T) => x!
|
||||
const assertNotNil = <T,>(x: T) => x!
|
||||
|
||||
const resetSpace = () => {
|
||||
space = ""
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<div class="column menu gap-2">
|
||||
{#if showSettings}
|
||||
<p class="mb-4 text-2xl text-center">
|
||||
<p class="mb-4 text-center text-2xl">
|
||||
Settings for <span class="text-primary">{displayRelayUrl(assertNotNil(space))}</span>
|
||||
</p>
|
||||
{#if getMembershipUrls($userMembership).includes(space || "")}
|
||||
@@ -82,7 +82,7 @@
|
||||
Go Back
|
||||
</Button>
|
||||
{:else if space}
|
||||
<p class="mb-4 text-2xl text-center">
|
||||
<p class="mb-4 text-center text-2xl">
|
||||
Actions for <span class="text-primary">{displayRelayUrl(space)}</span>
|
||||
</p>
|
||||
<div class="grid grid-cols-3 gap-2">
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<Button class="card2 bg-alt shadow-xl flex flex-col" on:click={onClick}>
|
||||
<Button class="card2 bg-alt flex flex-col shadow-xl" on:click={onClick}>
|
||||
<Profile {pubkey} />
|
||||
<ProfileInfo {pubkey} />
|
||||
{#if roots.length > 0}
|
||||
@@ -53,7 +53,7 @@
|
||||
{@const nevent = nip19.neventEncode({id: event.id, relays})}
|
||||
{@const following = getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
|
||||
<div class="divider" />
|
||||
<button type="button" class="chat chat-start cursor-default flex" on:click|stopPropagation>
|
||||
<button type="button" class="chat chat-start flex cursor-default" on:click|stopPropagation>
|
||||
<div class="bg-alt col-4 chat-bubble text-left">
|
||||
<Content showEntire hideMedia={!following} {event} />
|
||||
<Link external href={entityLink(nevent)} class="row-2 group justify-end whitespace-nowrap">
|
||||
|
||||
@@ -81,7 +81,8 @@
|
||||
|
||||
<slot />
|
||||
|
||||
<div class="fixed bottom-0 left-0 right-0 z-nav h-14 bg-base-100 md:hidden border border-top border-base-200">
|
||||
<div
|
||||
class="border-top fixed bottom-0 left-0 right-0 z-nav h-14 border border-base-200 bg-base-100 md:hidden">
|
||||
<div class="m-auto flex max-w-md justify-between px-2">
|
||||
<div class="flex gap-4 sm:gap-8">
|
||||
<PrimaryNavItem title="Home" on:click={showHomeMenu}>
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {ctx} from "@welshman/lib"
|
||||
import {repository} from "@welshman/app"
|
||||
import {getReplyFilters} from "@welshman/util"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Content from "@app/components/Content.svelte"
|
||||
import NoteCard from "@app/components/NoteCard.svelte"
|
||||
import {entityLink} from "@app/state"
|
||||
|
||||
export let event
|
||||
</script>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<slot name="input" />
|
||||
</div>
|
||||
{#if $$slots.info}
|
||||
<p class="text-sm col-start-2 col-span-2">
|
||||
<p class="col-span-2 col-start-2 text-sm">
|
||||
<slot name="info" />
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@@ -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..." />
|
||||
|
||||
@@ -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)}]})
|
||||
|
||||
Reference in New Issue
Block a user