diff --git a/src/app/components/GoalCreate.svelte b/src/app/components/GoalCreate.svelte index 41d87d51..5785bc69 100644 --- a/src/app/components/GoalCreate.svelte +++ b/src/app/components/GoalCreate.svelte @@ -185,7 +185,7 @@ {/if} -
+
{#snippet label()} Goal Amount (sats)* @@ -201,7 +201,7 @@ {/snippet} { + const toggleReaction = (events: TrustedEvent[]) => { const reaction = events.find(e => e.pubkey === $pubkey) if (reaction) { @@ -95,6 +97,26 @@ } } + const showReactors = (pubkeys: string[], title: string, subtitle: string) => + pushModal(ProfileList, {title, subtitle, pubkeys, url}) + + const onReactionClick = (events: TrustedEvent[], pubkeys: string[], info: string) => { + if (isMobile) { + showReactors(pubkeys, info.replace(" reacted", ""), "Reacted to this message") + return + } + + toggleReaction(events) + } + + const onZapClick = (pubkeys: string[], info: string) => { + if (isMobile) { + showReactors(pubkeys, info.replace(" zapped", ""), "Zapped this message") + } else { + pushModal(ZapModal, {url, pubkey: event.pubkey, eventId: event.id}) + } + } + const userIsAdmin = deriveUserIsSpaceAdmin(url) const onReportClick = () => pushModal(ReportDetails, {url, event}) @@ -158,6 +180,7 @@ {@const isOwn = $pubkey && pubkeys.includes($pubkey)} {@const info = displayList(pubkeys.map(pubkey => displayProfileByPubkey(pubkey)))} {@const tooltip = `${info} zapped`} + {@const onZapClickHandler = () => onZapClick(pubkeys, tooltip)} @@ -178,7 +202,7 @@ {@const isOwn = $pubkey && pubkeys.includes($pubkey)} {@const info = displayList(pubkeys.map(pubkey => displayProfileByPubkey(pubkey)))} {@const tooltip = `${info} reacted`} - {@const onClick = () => onReactionClick(events)} + {@const onClick = () => onReactionClick(events, pubkeys, info)} +
{:else if $members === undefined}
diff --git a/src/app/components/RoomItem.svelte b/src/app/components/RoomItem.svelte index 4ede5cd0..d30cc366 100644 --- a/src/app/components/RoomItem.svelte +++ b/src/app/components/RoomItem.svelte @@ -156,7 +156,7 @@
{#if !isMobile} + {#if h && $userIsRoomAdmin} +
  • + +
  • + {/if} {#if event.pubkey === $pubkey}
  • + {/if} {#if ENABLE_ZAPS} diff --git a/src/app/components/RoomPinnedMessages.svelte b/src/app/components/RoomPinnedMessages.svelte new file mode 100644 index 00000000..37627733 --- /dev/null +++ b/src/app/components/RoomPinnedMessages.svelte @@ -0,0 +1,192 @@ + + +{#if total > 0 && currentEvent} +
    +
    +
    + {#if expanded} +
    + +
    +

    Pinned message

    +

    + {formatNpub(currentEvent.pubkey)} +

    +
    +
    + {:else} + + {/if} +
    + +
    +
    + {#if expanded} +
    +
    + {#key currentEvent.id} + + {/key} +
    + +
    + {/if} +
    +
    +{/if} diff --git a/src/app/components/RoomPinnedMessagesAll.svelte b/src/app/components/RoomPinnedMessagesAll.svelte new file mode 100644 index 00000000..f16a2953 --- /dev/null +++ b/src/app/components/RoomPinnedMessagesAll.svelte @@ -0,0 +1,115 @@ + + + + + + Pinned Messages + + in + + +
    + {#each $pinnedEvents as event (event.id)} + {@const onUnpin = () => unpin(event)} + {@const onJump = () => jumpToMessage(event)} +
    +
    + +
    +

    + Pinned message +

    +

    + +

    +
    + +
    + +
    + {#if $userIsAdmin} + + {/if} + +
    +
    + {:else} +
    +

    No pinned messages.

    +
    + {/each} +
    +
    + + + +
    diff --git a/src/app/components/SpaceMember.svelte b/src/app/components/SpaceMember.svelte index 22b2ffd6..d91ddf6f 100644 --- a/src/app/components/SpaceMember.svelte +++ b/src/app/components/SpaceMember.svelte @@ -39,7 +39,7 @@
    {#if roles.length > 0} -
    +
    {#each roles as role (role.id)} {/each} diff --git a/src/app/components/ThreadBoard.svelte b/src/app/components/ThreadBoard.svelte index 0c1756f1..5bbac8fb 100644 --- a/src/app/components/ThreadBoard.svelte +++ b/src/app/components/ThreadBoard.svelte @@ -1,5 +1,6 @@ -
    +
    + class="flex items-center justify-between gap-2 border-b border-solid border-line px-4 py-3">

    {#if h} @@ -27,20 +28,30 @@ {threads.length === 1 ? "Topic" : "Topics"}

    - - - - - - - - - - + {#if $matchMd} +
    +
    + + + + + + + + + + {#each threads as event (event.id)} + + {/each} + +
    TopicAuthorRepliesLast post
    +
    + {:else} +
    {#each threads as event (event.id)} - + {/each} - - +
    + {/if} diff --git a/src/app/components/ThreadBoardItem.svelte b/src/app/components/ThreadBoardItem.svelte index 6b3cad06..6b8e9fce 100644 --- a/src/app/components/ThreadBoardItem.svelte +++ b/src/app/components/ThreadBoardItem.svelte @@ -11,9 +11,10 @@ type Props = { url: string event: TrustedEvent + mobile?: boolean } - const {url, event}: Props = $props() + const {url, event, mobile = false}: Props = $props() const filters = [{kinds: [COMMENT], "#E": [event.id]}] const replies = deriveEventsForUrl(url, filters) @@ -21,25 +22,47 @@ const lastActive = $derived(max([...$replies, event].map(e => e.created_at))) const title = getTagValue("title", event.tags) const path = makeThreadPath(url, event.id) + const goToThread = () => goto(path) - - - {title || "Untitled thread"} - - - - - - - - - {replyCount} - - - {formatTimestamp(lastActive)} - - +{#if mobile} + +{:else} + + + {title || "Untitled thread"} + + +
    + + + + +
    + + + {replyCount} + + + {formatTimestamp(lastActive)} + + +{/if} diff --git a/src/app/components/ThreadPost.svelte b/src/app/components/ThreadPost.svelte index 98b4abe1..e0626cd5 100644 --- a/src/app/components/ThreadPost.svelte +++ b/src/app/components/ThreadPost.svelte @@ -59,7 +59,7 @@ {displayHandle($handle)} {/if} {#if isOp} - OP + OP {/if}
    diff --git a/src/app/components/Zap.svelte b/src/app/components/Zap.svelte index ddb6ad04..63929ead 100644 --- a/src/app/components/Zap.svelte +++ b/src/app/components/Zap.svelte @@ -1,7 +1,5 @@ + +
    + + {#snippet label()} +

    Amount (sats)

    + {/snippet} + {#snippet secondary()} + + {content} + + {/snippet} + {#snippet input()} + + {/snippet} +
    +
    + {#each $zapAmounts as preset} + + {/each} +
    + {@render children?.()} +
    diff --git a/src/app/components/ZapInvoice.svelte b/src/app/components/ZapInvoice.svelte index c1f2d0e8..20f254aa 100644 --- a/src/app/components/ZapInvoice.svelte +++ b/src/app/components/ZapInvoice.svelte @@ -1,8 +1,6 @@