forked from coracle/flotilla
Lint, rename chat compose stuff
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
freshness,
|
||||
storageAdapters,
|
||||
} from "@welshman/app"
|
||||
import type {PublishStatusData, PublishStatusDataByUrlById} from "@welshman/app"
|
||||
import {createEventStore, adapter} from "@welshman/store"
|
||||
import * as app from "@welshman/app"
|
||||
import {createEventStore} from "@welshman/store"
|
||||
import ModalBox from "@lib/components/ModalBox.svelte"
|
||||
import Toast from "@app/components/Toast.svelte"
|
||||
import Landing from "@app/components/Landing.svelte"
|
||||
@@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
Object.assign(window, {get, state})
|
||||
Object.assign(window, {get, ...app, ...state})
|
||||
|
||||
ready = db
|
||||
? Promise.resolve()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {onMount} from "svelte"
|
||||
import Masonry from "svelte-bricks"
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import {load, relaySearch} from "@welshman/app"
|
||||
import {relaySearch} from "@welshman/app"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
import {userMembership, discoverRelays} from "@app/state"
|
||||
@@ -58,7 +58,7 @@
|
||||
<div class="card-body">
|
||||
<h2 class="card-title justify-center">{displayRelayUrl(relay.url)}</h2>
|
||||
{#if relay.profile?.description}
|
||||
<p class="py-4 text-sm text-center">{relay.profile.description}</p>
|
||||
<p class="py-4 text-center text-sm">{relay.profile.description}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {readable} from "svelte/store"
|
||||
import {displayRelayUrl, isShareableRelayUrl} from "@welshman/util"
|
||||
import type {SignedEvent} from "@welshman/util"
|
||||
import {subscribe, loadRelay, relaySearch} from "@welshman/app"
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import {relaySearch} from "@welshman/app"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import {INDEXER_RELAYS, discoverRelays} from "@app/state"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from 'nostr-tools'
|
||||
import {page} from "$app/stores"
|
||||
import {sort} from '@welshman/lib'
|
||||
import {displayRelayUrl} from '@welshman/util'
|
||||
import {sort} from "@welshman/lib"
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Page from "@lib/components/Page.svelte"
|
||||
@@ -104,7 +103,8 @@
|
||||
{#each rooms as topic, i (topic)}
|
||||
<div transition:fly|local={{delay: 250 + i * 50}}>
|
||||
<SecondaryNavItem href={makeSpacePath(url, topic)}>
|
||||
<Icon icon="hashtag" /> {topic}
|
||||
<Icon icon="hashtag" />
|
||||
{topic}
|
||||
</SecondaryNavItem>
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
import {subscribe, formatTimestampAsDate} from "@welshman/app"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import GroupNote from "@app/components/GroupNote.svelte"
|
||||
import GroupCompose from "@app/components/GroupCompose.svelte"
|
||||
import {deriveChat, userMembership, MESSAGE, REPLY} from "@app/state"
|
||||
import ChatMessage from "@app/components/ChatMessage.svelte"
|
||||
import ChatCompose from "@app/components/ChatCompose.svelte"
|
||||
import {deriveChat, MESSAGE, REPLY} from "@app/state"
|
||||
|
||||
const {url, topic} = $page.params
|
||||
const chat = deriveChat(url)
|
||||
@@ -62,7 +62,7 @@
|
||||
onMount(() => {
|
||||
const since = now() - 30
|
||||
const kinds = [MESSAGE, REPLY]
|
||||
const filter = topic ? {kinds, since, "#t": [topic]} : {kinds, since} as Filter
|
||||
const filter = topic ? {kinds, since, "#t": [topic]} : ({kinds, since} as Filter)
|
||||
const sub = subscribe({filters: [filter], relays: [url]})
|
||||
|
||||
return () => sub.close()
|
||||
@@ -87,7 +87,7 @@
|
||||
<div class="h-px flex-grow bg-base-content opacity-25" />
|
||||
</div>
|
||||
{:else}
|
||||
<GroupNote event={assertEvent(value)} {showPubkey} />
|
||||
<ChatMessage event={assertEvent(value)} {showPubkey} />
|
||||
{/if}
|
||||
{/each}
|
||||
<p class="flex h-10 items-center justify-center py-20">
|
||||
@@ -100,5 +100,5 @@
|
||||
</Spinner>
|
||||
</p>
|
||||
</div>
|
||||
<GroupCompose {url} {topic} />
|
||||
<ChatCompose {url} {topic} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user