forked from coracle/flotilla
Fix more stuff, particularly event handlers
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
children?: import("svelte").Snippet
|
||||
}
|
||||
|
||||
let {children}: Props = $props()
|
||||
const {children}: Props = $props()
|
||||
</script>
|
||||
|
||||
{#key $page.params.relay}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
children?: import("svelte").Snippet
|
||||
}
|
||||
|
||||
let {children}: Props = $props()
|
||||
const {children}: Props = $props()
|
||||
|
||||
const url = decodeRelay($page.params.relay)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
let relayAdminEvents: TrustedEvent[] = $state([])
|
||||
|
||||
let pubkey = $derived($relay?.profile?.pubkey)
|
||||
const pubkey = $derived($relay?.profile?.pubkey)
|
||||
</script>
|
||||
|
||||
<div class="relative flex flex-col">
|
||||
@@ -57,7 +57,7 @@
|
||||
{#snippet action()}
|
||||
<div class="row-2">
|
||||
{#if !$userRoomsByUrl.has(url)}
|
||||
<Button class="btn btn-primary btn-sm" on:click={joinSpace}>
|
||||
<Button class="btn btn-primary btn-sm" onclick={joinSpace}>
|
||||
<Icon icon="login-2" />
|
||||
Join Space
|
||||
</Button>
|
||||
@@ -166,7 +166,7 @@
|
||||
</div>
|
||||
</Link>
|
||||
{/each}
|
||||
<Button on:click={addRoom} class="btn btn-neutral whitespace-nowrap">
|
||||
<Button onclick={addRoom} class="btn btn-neutral whitespace-nowrap">
|
||||
<Icon icon="add-circle" />
|
||||
Create
|
||||
</Button>
|
||||
|
||||
@@ -208,12 +208,12 @@
|
||||
<div class="row-2">
|
||||
{#if room !== GENERAL}
|
||||
{#if $userRoomsByUrl.get(url)?.has(room)}
|
||||
<Button class="btn btn-neutral btn-sm" on:click={leaveRoom}>
|
||||
<Button class="btn btn-neutral btn-sm" onclick={leaveRoom}>
|
||||
<Icon icon="arrows-a-logout-2" />
|
||||
Leave Room
|
||||
</Button>
|
||||
{:else}
|
||||
<Button class="btn btn-neutral btn-sm" on:click={joinRoom}>
|
||||
<Button class="btn btn-neutral btn-sm" onclick={joinRoom}>
|
||||
<Icon icon="login-2" />
|
||||
Join Room
|
||||
</Button>
|
||||
@@ -256,7 +256,7 @@
|
||||
{#if showFixedNewMessages}
|
||||
<div class="relative z-feature flex justify-center">
|
||||
<div transition:fly={{duration: 200}} class="fixed top-12">
|
||||
<Button class="btn btn-primary btn-xs rounded-full" on:click={scrollToNewMessages}>
|
||||
<Button class="btn btn-primary btn-xs rounded-full" onclick={scrollToNewMessages}>
|
||||
New Messages
|
||||
</Button>
|
||||
</div>
|
||||
@@ -272,7 +272,7 @@
|
||||
|
||||
{#if showScrollButton}
|
||||
<div in:fade class="fixed bottom-14 right-4">
|
||||
<Button class="btn btn-circle btn-neutral" on:click={scrollToBottom}>
|
||||
<Button class="btn btn-circle btn-neutral" onclick={scrollToBottom}>
|
||||
<Icon icon="alt-arrow-down" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
dateDisplay?: string
|
||||
}
|
||||
|
||||
let items = $derived(
|
||||
const items = $derived(
|
||||
sortBy(e => -getStart(e), $events)
|
||||
.reduce<Item[]>((r, event) => {
|
||||
const end = getEnd(event)
|
||||
@@ -108,7 +108,7 @@
|
||||
<Button
|
||||
class="tooltip tooltip-left fixed bottom-16 right-2 z-feature p-1 md:bottom-4 md:right-4"
|
||||
data-tip="Create an Event"
|
||||
on:click={createEvent}>
|
||||
onclick={createEvent}>
|
||||
<div class="btn btn-circle btn-primary flex h-12 w-12 items-center justify-center">
|
||||
<Icon icon="calendar-add" />
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {onMount} from "svelte"
|
||||
import {derived} from "svelte/store"
|
||||
import {page} from "$app/stores"
|
||||
import {sortBy, min, nthEq, sleep} from "@welshman/lib"
|
||||
import {sortBy, min, nthEq} from "@welshman/lib"
|
||||
import {THREAD, COMMENT, getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||
import {throttled} from "@welshman/store"
|
||||
import {feedFromFilters, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
|
||||
@@ -96,7 +96,7 @@
|
||||
{/snippet}
|
||||
{#snippet action()}
|
||||
<div class="row-2">
|
||||
<Button class="btn btn-primary btn-sm" on:click={createThread}>
|
||||
<Button class="btn btn-primary btn-sm" onclick={createThread}>
|
||||
<Icon icon="notes-minimalistic" />
|
||||
Create a Thread
|
||||
</Button>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {sortBy, nthEq, sleep} from "@welshman/lib"
|
||||
import {COMMENT} from "@welshman/util"
|
||||
import {sortBy, sleep} from "@welshman/lib"
|
||||
import {COMMENT, getTagValue} from "@welshman/util"
|
||||
import {repository, subscribe} from "@welshman/app"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
@@ -40,8 +40,6 @@
|
||||
let showAll = $state(false)
|
||||
let showReply = $state(false)
|
||||
|
||||
let title = $derived($event?.tags.find(nthEq(0, "title"))?.[1] || "")
|
||||
|
||||
onMount(() => {
|
||||
const sub = subscribe({relays: [url], filters})
|
||||
|
||||
@@ -57,7 +55,7 @@
|
||||
{#if $event}
|
||||
{#if !showReply}
|
||||
<div class="flex justify-end px-2 pb-2">
|
||||
<Button class="btn btn-primary" on:click={openReply}>
|
||||
<Button class="btn btn-primary" onclick={openReply}>
|
||||
<Icon icon="reply" />
|
||||
Reply to thread
|
||||
</Button>
|
||||
@@ -73,7 +71,7 @@
|
||||
{/each}
|
||||
{#if !showAll && $replies.length > 4}
|
||||
<div class="flex justify-center">
|
||||
<Button class="btn btn-link" on:click={expand}>
|
||||
<Button class="btn btn-link" onclick={expand}>
|
||||
<Icon icon="sort-vertical" />
|
||||
Show all {$replies.length} replies
|
||||
</Button>
|
||||
@@ -95,14 +93,14 @@
|
||||
<PageBar class="mx-0">
|
||||
{#snippet icon()}
|
||||
<div>
|
||||
<Button class="btn btn-neutral btn-sm" on:click={back}>
|
||||
<Button class="btn btn-neutral btn-sm" onclick={back}>
|
||||
<Icon icon="alt-arrow-left" />
|
||||
Go back
|
||||
</Button>
|
||||
</div>
|
||||
{/snippet}
|
||||
{#snippet title()}
|
||||
<h1 class="text-xl">{title}</h1>
|
||||
<h1 class="text-xl">{getTagValue("title", $event?.tags || []) || ""}</h1>
|
||||
{/snippet}
|
||||
{#snippet action()}
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user