forked from coracle/flotilla
lint/format
This commit is contained in:
@@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-12 row-2">
|
<div class="row-2 ml-12">
|
||||||
{#if !isThread}
|
{#if !isThread}
|
||||||
<ReplySummary {event} />
|
<ReplySummary {event} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-12 row-2">
|
<div class="row-2 ml-12">
|
||||||
<ReplySummary {event} />
|
<ReplySummary {event} />
|
||||||
<ReactionSummary {event} {onReactionClick} />
|
<ReactionSummary {event} {onReactionClick} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
// If we found this event on a relay that the user is a member of, redirect internally
|
// If we found this event on a relay that the user is a member of, redirect internally
|
||||||
$: url = getMembershipUrls($userMembership).find(url => $trackerStore.hasRelay($event?.id, url))
|
$: url = getMembershipUrls($userMembership).find(url => $trackerStore.hasRelay($event?.id, url))
|
||||||
$: root = $event?.kind === REPLY ? $event.tags.find(nthEq(0, 'E'))?.[1] : $event?.id
|
$: root = $event?.kind === REPLY ? $event.tags.find(nthEq(0, "E"))?.[1] : $event?.id
|
||||||
$: href = url && root ? makeThreadPath(url, root) : entityLink(entity)
|
$: href = url && root ? makeThreadPath(url, root) : entityLink(entity)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,10 @@
|
|||||||
|
|
||||||
const reactions = deriveEvents(repository, {filters: [{kinds: [REACTION], "#e": [event.id]}]})
|
const reactions = deriveEvents(repository, {filters: [{kinds: [REACTION], "#e": [event.id]}]})
|
||||||
|
|
||||||
$: groupedReactions = groupBy(e => e.content, uniqBy(e => e.pubkey + e.content, $reactions))
|
$: groupedReactions = groupBy(
|
||||||
|
e => e.content,
|
||||||
|
uniqBy(e => e.pubkey + e.content, $reactions),
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#each groupedReactions.entries() as [content, events]}
|
{#each groupedReactions.entries() as [content, events]}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {groupBy, uniqBy} from "@welshman/lib"
|
|
||||||
import {REACTION} from "@welshman/util"
|
|
||||||
import {deriveEvents} from "@welshman/store"
|
import {deriveEvents} from "@welshman/store"
|
||||||
import {pubkey, repository} from "@welshman/app"
|
import {repository} from "@welshman/app"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import {REPLY} from "@app/state"
|
import {REPLY} from "@app/state"
|
||||||
|
|
||||||
|
|||||||
@@ -42,17 +42,17 @@
|
|||||||
$: lastActive = max([...$replies, event].map(e => e.created_at))
|
$: lastActive = max([...$replies, event].map(e => e.created_at))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex items-center justify-between flex-wrap gap-2">
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<ReactionSummary {event} {onReactionClick} />
|
<ReactionSummary {event} {onReactionClick} />
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2 flex-grow justify-end">
|
<div class="flex flex-grow justify-end gap-2">
|
||||||
{#if showActivity}
|
{#if showActivity}
|
||||||
<div class="flex-inline btn btn-neutral btn-xs gap-1 rounded-full">
|
<div class="flex-inline btn btn-neutral btn-xs gap-1 rounded-full">
|
||||||
<Icon icon="reply" />
|
<Icon icon="reply" />
|
||||||
<span>{$replies.length} {$replies.length === 1 ? "reply" : "replies"}</span>
|
<span>{$replies.length} {$replies.length === 1 ? "reply" : "replies"}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn btn-neutral btn-xs rounded-full hidden sm:flex">
|
<div class="btn btn-neutral btn-xs hidden rounded-full sm:flex">
|
||||||
Active {formatTimestampRelative(lastActive)}
|
Active {formatTimestampRelative(lastActive)}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
component={ThreadMenu}
|
component={ThreadMenu}
|
||||||
props={{url, event, onClick: hidePopover}}
|
props={{url, event, onClick: hidePopover}}
|
||||||
params={{trigger: "manual", interactive: true}}>
|
params={{trigger: "manual", interactive: true}}>
|
||||||
<Button class="btn btn-neutral btn-xs join-item" on:click={showPopover}>
|
<Button class="btn join-item btn-neutral btn-xs" on:click={showPopover}>
|
||||||
<Icon icon="menu-dots" size={4} />
|
<Icon icon="menu-dots" size={4} />
|
||||||
</Button>
|
</Button>
|
||||||
</Tippy>
|
</Tippy>
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {formatTimestamp, formatTimestampRelative} from "@welshman/app"
|
import {formatTimestamp} from "@welshman/app"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
|
||||||
import Link from "@lib/components/Link.svelte"
|
import Link from "@lib/components/Link.svelte"
|
||||||
import Content from "@app/components/Content.svelte"
|
import Content from "@app/components/Content.svelte"
|
||||||
import Profile from "@app/components/Profile.svelte"
|
import Profile from "@app/components/Profile.svelte"
|
||||||
import ThreadActions from "@app/components/ThreadActions.svelte"
|
import ThreadActions from "@app/components/ThreadActions.svelte"
|
||||||
import {makeThreadPath} from "@app/routes"
|
import {makeThreadPath} from "@app/routes"
|
||||||
import {REPLY} from "@app/state"
|
|
||||||
|
|
||||||
export let url
|
export let url
|
||||||
export let event
|
export let event
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {nip19} from "nostr-tools"
|
import {nip19} from "nostr-tools"
|
||||||
import {goto} from '$app/navigation'
|
import {goto} from "$app/navigation"
|
||||||
import {ctx} from '@welshman/lib'
|
import {ctx} from "@welshman/lib"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import FieldInline from "@lib/components/FieldInline.svelte"
|
|
||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
||||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||||
@@ -18,8 +17,7 @@
|
|||||||
|
|
||||||
const back = () => history.back()
|
const back = () => history.back()
|
||||||
|
|
||||||
const onSubmit = () =>
|
const onSubmit = () => goto(makeRoomPath(url, selection) + "?content=nostr:" + nevent)
|
||||||
goto(makeRoomPath(url, selection) + '?content=nostr:' + nevent)
|
|
||||||
|
|
||||||
const toggleRoom = (room: string) => {
|
const toggleRoom = (room: string) => {
|
||||||
selection = room === selection ? "" : room
|
selection = room === selection ? "" : room
|
||||||
|
|||||||
+1
-2
@@ -13,8 +13,7 @@ export const makeSpacePath = (url: string, extra = "") => {
|
|||||||
|
|
||||||
export const makeChatPath = (pubkeys: string[]) => `/chat/${makeChatId(pubkeys)}`
|
export const makeChatPath = (pubkeys: string[]) => `/chat/${makeChatId(pubkeys)}`
|
||||||
|
|
||||||
export const makeRoomPath = (url: string, room: string) =>
|
export const makeRoomPath = (url: string, room: string) => `/spaces/${encodeRelay(url)}/${room}`
|
||||||
`/spaces/${encodeRelay(url)}/${room}`
|
|
||||||
|
|
||||||
export const makeThreadPath = (url: string, eventId: string) =>
|
export const makeThreadPath = (url: string, eventId: string) =>
|
||||||
`/spaces/${encodeRelay(url)}/threads/${eventId}`
|
`/spaces/${encodeRelay(url)}/threads/${eventId}`
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user