Lint/format
This commit is contained in:
+4
-9
@@ -1,11 +1,10 @@
|
||||
import {get} from "svelte/store"
|
||||
import {ctx, uniqBy, uniq, sleep, chunk, equals, choice, append} from "@welshman/lib"
|
||||
import {ctx, uniq, sleep, chunk, equals, choice} from "@welshman/lib"
|
||||
import {
|
||||
DELETE,
|
||||
PROFILE,
|
||||
INBOX_RELAYS,
|
||||
RELAYS,
|
||||
MUTES,
|
||||
FOLLOWS,
|
||||
REACTION,
|
||||
isSignedEvent,
|
||||
@@ -14,7 +13,6 @@ import {
|
||||
normalizeRelayUrl,
|
||||
makeList,
|
||||
addToListPublicly,
|
||||
removeFromList,
|
||||
removeFromListByPredicate,
|
||||
getListTags,
|
||||
getRelayTags,
|
||||
@@ -37,7 +35,6 @@ import {
|
||||
loadMutes,
|
||||
getFollows,
|
||||
tagEvent,
|
||||
tagPubkey,
|
||||
tagReactionTo,
|
||||
getRelayUrls,
|
||||
userRelaySelections,
|
||||
@@ -155,8 +152,7 @@ export const removeRoomMembership = async (url: string, room: string) => {
|
||||
export const setRelayPolicy = (url: string, read: boolean, write: boolean) => {
|
||||
const list = get(userRelaySelections) || makeList({kind: RELAYS})
|
||||
|
||||
let tags = getRelayTags(getListTags(list))
|
||||
.filter(t => normalizeRelayUrl(t[1]) !== url)
|
||||
const tags = getRelayTags(getListTags(list)).filter(t => normalizeRelayUrl(t[1]) !== url)
|
||||
|
||||
if (read && write) {
|
||||
tags.push(["r", url])
|
||||
@@ -177,8 +173,7 @@ export const setInboxRelayPolicy = (url: string, enabled: boolean) => {
|
||||
|
||||
// Only update inbox policies if they already exist or we're adding them
|
||||
if (enabled || getRelayUrls(list).includes(url)) {
|
||||
let tags = getRelayTags(getListTags(list))
|
||||
.filter(t => normalizeRelayUrl(t[1]) !== url)
|
||||
const tags = getRelayTags(getListTags(list)).filter(t => normalizeRelayUrl(t[1]) !== url)
|
||||
|
||||
if (enabled) {
|
||||
tags.push(["relay", url])
|
||||
@@ -222,7 +217,7 @@ export const sendWrapped = async ({
|
||||
makeThunk({
|
||||
event: await nip59.wrap(recipient, stamp(template)),
|
||||
relays: ctx.app.router.PublishMessage(recipient).getUrls(),
|
||||
})
|
||||
}),
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
const profileDisplay = deriveProfileDisplay(event.pubkey)
|
||||
const reactions = deriveEvents(repository, {filters: [{kinds: [REACTION], "#e": [event.id]}]})
|
||||
const zaps = deriveEvents(repository, {filters: [{kinds: [ZAP_RESPONSE], "#e": [event.id]}]})
|
||||
const [colorName, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
||||
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
||||
const ps = derived(publishStatusData, $m => Object.values($m[event.id] || {}))
|
||||
|
||||
const showProfile = () => pushDrawer(ProfileDetail, {pubkey: event.pubkey})
|
||||
@@ -57,17 +57,24 @@
|
||||
class="group chat relative flex w-full flex-col gap-1 p-2 text-left"
|
||||
class:chat-start={event.pubkey !== $pubkey}
|
||||
class:chat-end={event.pubkey === $pubkey}>
|
||||
<div class="chat-bubble max-w-sm mx-1">
|
||||
<div class="flex gap-2 items-start">
|
||||
<div class="chat-bubble mx-1 max-w-sm">
|
||||
<div class="flex items-start gap-2">
|
||||
{#if showPubkey}
|
||||
<button type="button" on:click|stopPropagation={showProfile}>
|
||||
<Avatar src={$profile?.picture} class="border border-solid border-base-content" size={10} />
|
||||
<Avatar
|
||||
src={$profile?.picture}
|
||||
class="border border-solid border-base-content"
|
||||
size={10} />
|
||||
</button>
|
||||
{/if}
|
||||
<div class="-mt-1 flex-grow pr-1">
|
||||
{#if showPubkey}
|
||||
<div class="flex items-center gap-2">
|
||||
<button type="button" class="text-bold text-sm" style="color: {colorValue}" on:click|stopPropagation={showProfile}>
|
||||
<button
|
||||
type="button"
|
||||
class="text-bold text-sm"
|
||||
style="color: {colorValue}"
|
||||
on:click|stopPropagation={showProfile}>
|
||||
{$profileDisplay}
|
||||
</button>
|
||||
<span class="text-xs opacity-50">{formatTimestampAsTime(event.created_at)}</span>
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
<script lang="ts">
|
||||
import {goto} from '$app/navigation'
|
||||
import Icon from '@lib/components/Icon.svelte'
|
||||
import Link from '@lib/components/Link.svelte'
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
import Divider from '@lib/components/Divider.svelte'
|
||||
import CardButton from '@lib/components/CardButton.svelte'
|
||||
import SpaceAvatar from "@app/components/SpaceAvatar.svelte"
|
||||
import RelayName from "@app/components/RelayName.svelte"
|
||||
import RelayDescription from "@app/components/RelayDescription.svelte"
|
||||
import SpaceCreateExternal from "@app/components/SpaceCreateExternal.svelte"
|
||||
import {userMembership, getMembershipUrls} from "@app/state"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
const createSpace = () => pushModal(SpaceCreateExternal)
|
||||
|
||||
const browseSpaces = () => goto("/discover")
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import CardButton from "@lib/components/CardButton.svelte"
|
||||
</script>
|
||||
|
||||
<div class="menu column gap-2">
|
||||
<div class="column menu gap-2">
|
||||
<Link href="/home/people">
|
||||
<CardButton>
|
||||
<div slot="icon"><Icon icon="user-heart" size={7} /></div>
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
<script lang="ts">
|
||||
import {goto} from '$app/navigation'
|
||||
import Icon from '@lib/components/Icon.svelte'
|
||||
import Link from '@lib/components/Link.svelte'
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
import CardButton from '@lib/components/CardButton.svelte'
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import CardButton from "@lib/components/CardButton.svelte"
|
||||
import LogOut from "@app/components/LogOut.svelte"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
const back = () => history.back()
|
||||
|
||||
const logout = () => pushModal(LogOut)
|
||||
</script>
|
||||
|
||||
<div class="menu column gap-2">
|
||||
<div class="column menu gap-2">
|
||||
<Link href="/settings/profile">
|
||||
<CardButton>
|
||||
<div slot="icon"><Icon icon="user-circle" size={7} /></div>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import {page} from '$app/stores'
|
||||
import {goto} from '$app/navigation'
|
||||
import Icon from '@lib/components/Icon.svelte'
|
||||
import Link from '@lib/components/Link.svelte'
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
import Divider from '@lib/components/Divider.svelte'
|
||||
import CardButton from '@lib/components/CardButton.svelte'
|
||||
import {page} from "$app/stores"
|
||||
import {goto} from "$app/navigation"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Divider from "@lib/components/Divider.svelte"
|
||||
import CardButton from "@lib/components/CardButton.svelte"
|
||||
import SpaceAvatar from "@app/components/SpaceAvatar.svelte"
|
||||
import RelayName from "@app/components/RelayName.svelte"
|
||||
import RelayDescription from "@app/components/RelayDescription.svelte"
|
||||
@@ -13,7 +13,14 @@
|
||||
import SpaceExit from "@app/components/SpaceExit.svelte"
|
||||
import SpaceJoin from "@app/components/SpaceJoin.svelte"
|
||||
import RoomCreate from "@app/components/RoomCreate.svelte"
|
||||
import {GENERAL, userMembership, decodeNRelay, getMembershipRoomsByUrl, getMembershipUrls, roomsByUrl} from "@app/state"
|
||||
import {
|
||||
GENERAL,
|
||||
userMembership,
|
||||
decodeNRelay,
|
||||
getMembershipRoomsByUrl,
|
||||
getMembershipUrls,
|
||||
roomsByUrl,
|
||||
} from "@app/state"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
@@ -51,9 +58,9 @@
|
||||
$: otherRooms = allRooms.filter(room => !rooms.concat(GENERAL).includes(room))
|
||||
</script>
|
||||
|
||||
<div class="menu column gap-2">
|
||||
<div class="column menu gap-2">
|
||||
{#if showSettings}
|
||||
<Button on:click={closeSettings} class="flex items-center gap-2 text-lg mb-4">
|
||||
<Button on:click={closeSettings} class="mb-4 flex items-center gap-2 text-lg">
|
||||
<Icon icon="alt-arrow-left" size={7} />
|
||||
Go Back
|
||||
</Button>
|
||||
@@ -69,7 +76,7 @@
|
||||
</Button>
|
||||
{/if}
|
||||
{:else if space}
|
||||
<Button on:click={resetSpace} class="flex items-center gap-2 text-lg mb-4">
|
||||
<Button on:click={resetSpace} class="mb-4 flex items-center gap-2 text-lg">
|
||||
<Icon icon="alt-arrow-left" size={7} />
|
||||
Back to Spaces
|
||||
</Button>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {nip19} from "nostr-tools"
|
||||
import {ago, append, first, sortBy, WEEK, ctx} from "@welshman/lib"
|
||||
import {NOTE, getAncestorTags, getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||
import type {Filter} from "@welshman/util"
|
||||
@@ -46,8 +45,6 @@
|
||||
<ProfileInfo {pubkey} />
|
||||
{#if roots.length > 0}
|
||||
{@const event = first(sortBy(e => -e.created_at, roots))}
|
||||
{@const relays = ctx.app.router.Event(event).getUrls()}
|
||||
{@const nevent = nip19.neventEncode({id: event.id, relays})}
|
||||
{@const following = getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
|
||||
<div class="divider" />
|
||||
<Button class="chat chat-start" on:click={onClick}>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import {page} from "$app/stores"
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import {userProfile} from "@welshman/app"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
@@ -11,7 +10,7 @@
|
||||
import MenuSettings from "@app/components/MenuSettings.svelte"
|
||||
import {userMembership, getMembershipUrls} from "@app/state"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {makeSpacePath, getPrimaryNavItemIndex} from "@app/routes"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
|
||||
const addSpace = () => pushModal(SpaceAdd)
|
||||
|
||||
@@ -22,14 +21,17 @@
|
||||
const showSettingsMenu = () => pushModal(MenuSettings)
|
||||
</script>
|
||||
|
||||
<div class="relative w-14 flex-shrink-0 bg-base-100 pt-4 hidden sm:block">
|
||||
<div class="relative hidden w-14 flex-shrink-0 bg-base-100 pt-4 sm:block">
|
||||
<div class="flex h-full flex-col justify-between">
|
||||
<div>
|
||||
<PrimaryNavItem href="/home" class="tooltip-right">
|
||||
<Avatar src={$userProfile?.picture} class="!h-10 !w-10" />
|
||||
</PrimaryNavItem>
|
||||
{#each getMembershipUrls($userMembership) as url (url)}
|
||||
<PrimaryNavItem title={displayRelayUrl(url)} href={makeSpacePath(url)} class="tooltip-right">
|
||||
<PrimaryNavItem
|
||||
title={displayRelayUrl(url)}
|
||||
href={makeSpacePath(url)}
|
||||
class="tooltip-right">
|
||||
<SpaceAvatar {url} />
|
||||
</PrimaryNavItem>
|
||||
{/each}
|
||||
@@ -50,8 +52,8 @@
|
||||
|
||||
<slot />
|
||||
|
||||
<div class="fixed bottom-0 left-0 right-0 h-14 bg-base-100 sm:hidden z-nav">
|
||||
<div class="flex justify-between max-w-sm m-auto px-2">
|
||||
<div class="fixed bottom-0 left-0 right-0 z-nav h-14 bg-base-100 sm:hidden">
|
||||
<div class="m-auto flex max-w-sm justify-between px-2">
|
||||
<PrimaryNavItem title="Home" on:click={showHomeMenu}>
|
||||
<Avatar icon="home-smile" class="!h-10 !w-10" />
|
||||
</PrimaryNavItem>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from "nostr-tools"
|
||||
import {displayPubkey, getPubkeyTagValues, getListTags} from "@welshman/util"
|
||||
import {
|
||||
userFollows,
|
||||
@@ -17,7 +16,6 @@
|
||||
|
||||
export let pubkey
|
||||
|
||||
const npub = nip19.npubEncode(pubkey)
|
||||
const profile = deriveProfile(pubkey)
|
||||
const profileDisplay = deriveProfileDisplay(pubkey)
|
||||
const handle = deriveHandleForPubkey(pubkey)
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from 'svelte'
|
||||
import {sleep, sortBy, flatten} from '@welshman/lib'
|
||||
import {feedFromFilter} from '@welshman/feeds'
|
||||
import {NOTE, displayProfile, displayPubkey, getAncestorTags} from '@welshman/util'
|
||||
import {deriveEvents} from '@welshman/store'
|
||||
import type {TrustedEvent} from '@welshman/util'
|
||||
import {repository, deriveProfile, displayNip05, feedLoader} from '@welshman/app'
|
||||
import {onMount} from "svelte"
|
||||
import {sleep, sortBy, flatten} from "@welshman/lib"
|
||||
import {feedFromFilter} from "@welshman/feeds"
|
||||
import {NOTE, displayProfile, displayPubkey, getAncestorTags} from "@welshman/util"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {repository, deriveProfile, displayNip05, feedLoader} from "@welshman/app"
|
||||
import {createScroller} from "@lib/html"
|
||||
import {fly} from '@lib/transition'
|
||||
import {fly} from "@lib/transition"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
import Spinner from '@lib/components/Spinner.svelte'
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Content from "@app/components/Content.svelte"
|
||||
import NoteCard from "@app/components/NoteCard.svelte"
|
||||
|
||||
@@ -25,7 +24,7 @@
|
||||
|
||||
onMount(() => {
|
||||
const scroller = createScroller({
|
||||
element: element.closest('.menu')!,
|
||||
element: element.closest(".menu")!,
|
||||
onScroll: async () => {
|
||||
const $loader = await loader
|
||||
|
||||
@@ -37,7 +36,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-4 p-4 max-w-full" bind:this={element}>
|
||||
<div class="flex max-w-full flex-col gap-4 p-4" bind:this={element}>
|
||||
{#if $profile}
|
||||
<div class="flex max-w-full gap-3">
|
||||
<div class="py-1">
|
||||
@@ -71,7 +70,7 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<p class="flex center my-12">
|
||||
<p class="center my-12 flex">
|
||||
{#await sleep(3000)}
|
||||
<Spinner loading />
|
||||
{:then}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from "nostr-tools"
|
||||
import type {SvelteComponent} from "svelte"
|
||||
import {type Instance} from "tippy.js"
|
||||
import {append, remove, uniq} from "@welshman/lib"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {deriveRelay} from '@welshman/app'
|
||||
import {deriveRelay} from "@welshman/app"
|
||||
|
||||
export let url
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {deriveRelayDisplay} from '@welshman/app'
|
||||
import {deriveRelayDisplay} from "@welshman/app"
|
||||
|
||||
export let url
|
||||
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
<form class="column gap-4" on:submit|preventDefault={next}>
|
||||
<ModalHeader>
|
||||
<div slot="title">Customize your Space</div>
|
||||
<div slot="info">
|
||||
Give people a few details to go on. You can always change this later.
|
||||
</div>
|
||||
<div slot="info">Give people a few details to go on. You can always change this later.</div>
|
||||
</ModalHeader>
|
||||
<div class="flex justify-center py-2">
|
||||
<InputProfilePicture bind:file />
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
<form class="column gap-4" on:submit|preventDefault={next}>
|
||||
<ModalHeader>
|
||||
<div slot="title">Create a Space</div>
|
||||
<div slot="info">
|
||||
Host your own space, for your community.
|
||||
</div>
|
||||
<div slot="info">Host your own space, for your community.</div>
|
||||
</ModalHeader>
|
||||
<p>
|
||||
<Link class="text-primary" external href="https://relay.tools">relay.tools</Link> is a third-party
|
||||
|
||||
@@ -35,9 +35,7 @@
|
||||
<div slot="title">
|
||||
Joining <span class="text-primary">{displayRelayUrl(url)}</span>
|
||||
</div>
|
||||
<div slot="info">
|
||||
Are you sure you'd like to join this space?
|
||||
</div>
|
||||
<div slot="info">Are you sure you'd like to join this space?</div>
|
||||
</ModalHeader>
|
||||
<div class="flex flex-row items-center justify-between gap-4">
|
||||
<Button class="btn btn-link" on:click={back}>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</NoteCard>
|
||||
<Link
|
||||
href={entityLink(nevent)}
|
||||
class="btn btn-neutral -mt-6 mr-4 flex items-center gap-2 rounded-full z-feature">
|
||||
class="btn btn-neutral z-feature -mt-6 mr-4 flex items-center gap-2 rounded-full">
|
||||
<Icon icon="chat-round" />
|
||||
<span>{replies.length}</span>
|
||||
</Link>
|
||||
|
||||
+8
-6
@@ -214,17 +214,19 @@ export const deriveEvent = (idOrAddress: string, hints: string[] = []) => {
|
||||
|
||||
// Membership
|
||||
|
||||
export const getMembershipUrls = (list?: List) =>
|
||||
sort(getRelayTagValues(getListTags(list)))
|
||||
export const getMembershipUrls = (list?: List) => sort(getRelayTagValues(getListTags(list)))
|
||||
|
||||
export const getMembershipRoomsByUrl = (url: string, list?: List) =>
|
||||
sort(getListTags(list).filter(t => t[0] === '~' && t[2] === url).map(nth(1)))
|
||||
sort(
|
||||
getListTags(list)
|
||||
.filter(t => t[0] === "~" && t[2] === url)
|
||||
.map(nth(1)),
|
||||
)
|
||||
|
||||
export const memberships = deriveEventsMapped<PublishedList>(repository, {
|
||||
filters: [{kinds: [MEMBERSHIPS]}],
|
||||
itemToEvent: item => item.event,
|
||||
eventToItem: (event: TrustedEvent) =>
|
||||
readList(asDecryptedEvent(event)),
|
||||
eventToItem: (event: TrustedEvent) => readList(asDecryptedEvent(event)),
|
||||
})
|
||||
|
||||
export const {
|
||||
@@ -429,7 +431,7 @@ export const threadsByUrl = derived(
|
||||
}
|
||||
|
||||
return threadsByUrl
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
// Rooms
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
</script>
|
||||
|
||||
<div class="btn btn-neutral btn-lg h-24 text-left w-full">
|
||||
<div class="flex gap-2 flex-row justify-between items-center w-full {$$props.class}">
|
||||
<div class="flex gap-6 items-center">
|
||||
<div class="w-12 center">
|
||||
<div class="btn btn-neutral btn-lg h-24 w-full text-left">
|
||||
<div class="flex w-full flex-row items-center justify-between gap-2 {$$props.class}">
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="center w-12">
|
||||
<slot name="icon" />
|
||||
</div>
|
||||
<div class="flex flex-grow flex-col gap-1">
|
||||
@@ -13,7 +13,7 @@
|
||||
<p class="text-xs"><slot name="info" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-12 center">
|
||||
<div class="center w-12">
|
||||
<Icon size={7} icon="alt-arrow-right" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
<div class="drawer-side z-modal">
|
||||
<label for={id} aria-label="close sidebar" class="drawer-overlay"></label>
|
||||
<div class="menu overflow-auto h-full w-80 bg-base-200 p-0 text-base-content">
|
||||
<div class="menu h-full w-80 overflow-auto bg-base-200 p-0 text-base-content">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="column gap-2 py-4 max-w-xs m-auto">
|
||||
<div class="column m-auto max-w-xs gap-2 py-4">
|
||||
<h1 class="heading"><slot name="title" /></h1>
|
||||
<p class="text-center"><slot name="info" /></p>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="max-h-screen flex-grow overflow-auto bg-base-200 mb-2 pb-12 sm:mb-0 sm:pb-0">
|
||||
<div class="mb-2 max-h-screen flex-grow overflow-auto bg-base-200 pb-12 sm:mb-0 sm:pb-0">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<script lang="ts">
|
||||
import Icon from '@lib/components/Icon.svelte'
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
|
||||
const back = () => history.back()
|
||||
</script>
|
||||
|
||||
<div class="relative z-feature mx-2 rounded-xl pt-4">
|
||||
<div
|
||||
class="flex min-h-12 items-center justify-between gap-4 rounded-xl bg-base-100 px-4 shadow-xl">
|
||||
|
||||
@@ -2,4 +2,3 @@
|
||||
<h1 class="superheading"><slot name="title" /></h1>
|
||||
<p class="text-center"><slot name="info" /></p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {page} from '$app/stores'
|
||||
import {page} from "$app/stores"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
|
||||
export let title = ""
|
||||
@@ -11,7 +11,7 @@
|
||||
{#if href}
|
||||
<a {href} class="relative z-nav-item flex h-14 w-14 items-center justify-center">
|
||||
<div
|
||||
class="avatar cursor-pointer rounded-full p-1 {$$props.class} hover:bg-base-300 transition-colors"
|
||||
class="avatar cursor-pointer rounded-full p-1 {$$props.class} transition-colors hover:bg-base-300"
|
||||
class:bg-base-300={active}
|
||||
class:tooltip={title}
|
||||
data-tip={title}>
|
||||
@@ -21,7 +21,7 @@
|
||||
{:else}
|
||||
<Button on:click class="relative z-nav-item flex h-14 w-14 items-center justify-center">
|
||||
<div
|
||||
class="avatar cursor-pointer rounded-full p-1 {$$props.class} hover:bg-base-300 transition-colors"
|
||||
class="avatar cursor-pointer rounded-full p-1 {$$props.class} transition-colors hover:bg-base-300"
|
||||
class:bg-base-300={active}
|
||||
class:tooltip={title}
|
||||
data-tip={title}>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="max-h-screen w-60 flex-shrink-0 flex-col gap-1 bg-base-300 hidden sm:flex">
|
||||
<div class="hidden max-h-screen w-60 flex-shrink-0 flex-col gap-1 bg-base-300 sm:flex">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
let:item={relay}>
|
||||
<a
|
||||
href={makeSpacePath(relay.url)}
|
||||
class="flex flex-col gap-2 card2 text-center bg-alt shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]">
|
||||
class="card2 bg-alt flex flex-col gap-2 text-center shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]">
|
||||
<div class="center avatar mt-8">
|
||||
<div
|
||||
class="center relative !flex w-20 rounded-full border-2 border-solid border-base-300 bg-base-300">
|
||||
@@ -77,7 +77,7 @@
|
||||
<h2 class="text-center text-xl">
|
||||
<RelayName url={relay.url} />
|
||||
</h2>
|
||||
<p class="opacity-75 text-sm">{relay.url}</p>
|
||||
<p class="text-sm opacity-75">{relay.url}</p>
|
||||
</div>
|
||||
<RelayDescription url={relay.url} />
|
||||
</a>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
</SecondaryNavSection>
|
||||
<label
|
||||
class="input input-sm input-bordered mx-6 -mt-4 flex items-center gap-2 mb-2"
|
||||
class="input input-sm input-bordered mx-6 -mt-4 mb-2 flex items-center gap-2"
|
||||
in:fly={{delay: 250}}>
|
||||
<Icon icon="magnifer" />
|
||||
<input bind:value={term} class="grow" type="text" />
|
||||
|
||||
@@ -9,18 +9,10 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {page} from "$app/stores"
|
||||
import {ctx, uniq, sortBy, remove} from "@welshman/lib"
|
||||
import {sortBy, remove} from "@welshman/lib"
|
||||
import type {TrustedEvent, EventContent} from "@welshman/util"
|
||||
import {createEvent, DIRECT_MESSAGE} from "@welshman/util"
|
||||
import {Nip59} from "@welshman/signer"
|
||||
import {
|
||||
pubkey,
|
||||
signer,
|
||||
formatTimestampAsDate,
|
||||
tagPubkey,
|
||||
makeThunk,
|
||||
publishThunk,
|
||||
} from "@welshman/app"
|
||||
import {pubkey, formatTimestampAsDate, tagPubkey} from "@welshman/app"
|
||||
import {fly} from "@lib/transition"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Divider from "@lib/components/Divider.svelte"
|
||||
@@ -32,7 +24,7 @@
|
||||
import {deriveChat, splitChatId} from "@app/state"
|
||||
import {sendWrapped} from "@app/commands"
|
||||
|
||||
const id = $page.params.chat === 'notes' ? $pubkey! : $page.params.chat
|
||||
const id = $page.params.chat === "notes" ? $pubkey! : $page.params.chat
|
||||
const chat = deriveChat(id)
|
||||
const pubkeys = splitChatId(id)
|
||||
const others = remove($pubkey, pubkeys)
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {ctx, ago, remove} from "@welshman/lib"
|
||||
import {WRAP} from "@welshman/util"
|
||||
import {pubkey, subscribe} from "@welshman/app"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Page from "@lib/components/Page.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import SecondaryNav from "@lib/components/SecondaryNav.svelte"
|
||||
import SecondaryNavItem from "@lib/components/SecondaryNavItem.svelte"
|
||||
import SecondaryNavHeader from "@lib/components/SecondaryNavHeader.svelte"
|
||||
import SecondaryNavSection from "@lib/components/SecondaryNavSection.svelte"
|
||||
import Name from "@app/components/Name.svelte"
|
||||
import ProfileCircle from "@app/components/ProfileCircle.svelte"
|
||||
import ProfileCircles from "@app/components/ProfileCircles.svelte"
|
||||
import ChatStart from "@app/components/ChatStart.svelte"
|
||||
import {chatSearch, pullConservatively} from "@app/state"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
let term = ""
|
||||
|
||||
@@ -38,15 +29,15 @@
|
||||
</script>
|
||||
|
||||
<div class="content column gap-2">
|
||||
<label class="input input-bordered flex items-center gap-2 mb-2" in:fly={{delay: 250}}>
|
||||
<label class="input input-bordered mb-2 flex items-center gap-2" in:fly={{delay: 250}}>
|
||||
<Icon icon="magnifer" />
|
||||
<input bind:value={term} class="grow" type="text" placeholder="Search for conversations..." />
|
||||
</label>
|
||||
<div class="overflow-auto column gap-2">
|
||||
<div class="column gap-2 overflow-auto">
|
||||
{#each chats as { id, pubkeys, messages }, i (id)}
|
||||
{@const message = messages[0]}
|
||||
{@const others = remove($pubkey, pubkeys)}
|
||||
<div class="cursor-pointer card2 bg-alt hover:bg-alt px-6 py-2 transition-colors">
|
||||
<div class="card2 bg-alt hover:bg-alt cursor-pointer px-6 py-2 transition-colors">
|
||||
<Link class="flex flex-col justify-start gap-1" href="/home/{id}">
|
||||
<div class="flex items-center gap-2">
|
||||
{#if others.length === 1}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<div class="content column gap-4" bind:this={element}>
|
||||
<h1 class="superheading mt-20 hidden sm:block">People</h1>
|
||||
<p class="text-center hidden sm:block">Get the latest from people in your network</p>
|
||||
<p class="hidden text-center sm:block">Get the latest from people in your network</p>
|
||||
<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 {always, ctx} from "@welshman/lib"
|
||||
import {ctx} from "@welshman/lib"
|
||||
import {getListTags, createEvent, getPubkeyTagValues, MUTES} from "@welshman/util"
|
||||
import {userMutes, tagPubkey, publishThunk} from "@welshman/app"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import ProfileDetail from '@app/components/ProfileDetail.svelte'
|
||||
import {pushDrawer} from '@app/modal'
|
||||
import ProfileDetail from "@app/components/ProfileDetail.svelte"
|
||||
import {pushDrawer} from "@app/modal"
|
||||
|
||||
const openProfile = () =>
|
||||
pushDrawer(ProfileDetail, {pubkey: '97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322'})
|
||||
pushDrawer(ProfileDetail, {
|
||||
pubkey: "97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322",
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="mt-8 sm:hero min-h-screen bg-base-200">
|
||||
<div class="mt-8 min-h-screen bg-base-200 sm:hero">
|
||||
<div class="hero-content">
|
||||
<div class="column content gap-6">
|
||||
<p class="text-center text-2xl">Thanks for using</p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {last, ctx} from "@welshman/lib"
|
||||
import {ctx} from "@welshman/lib"
|
||||
import {
|
||||
createEvent,
|
||||
displayPubkey,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {sort, ago} from "@welshman/lib"
|
||||
import {ago} from "@welshman/lib"
|
||||
import {displayRelayUrl, REACTION, NOTE, EVENT_DATE, EVENT_TIME, CLASSIFIED} from "@welshman/util"
|
||||
import {subscribe} from "@welshman/app"
|
||||
import {fly, slide} from "@lib/transition"
|
||||
@@ -16,7 +16,16 @@
|
||||
import SpaceExit from "@app/components/SpaceExit.svelte"
|
||||
import SpaceJoin from "@app/components/SpaceJoin.svelte"
|
||||
import RoomCreate from "@app/components/RoomCreate.svelte"
|
||||
import {getMembershipRoomsByUrl, getMembershipUrls, userMembership, pullConservatively, roomsByUrl, decodeNRelay, GENERAL, MESSAGE} from "@app/state"
|
||||
import {
|
||||
getMembershipRoomsByUrl,
|
||||
getMembershipUrls,
|
||||
userMembership,
|
||||
pullConservatively,
|
||||
roomsByUrl,
|
||||
decodeNRelay,
|
||||
GENERAL,
|
||||
MESSAGE,
|
||||
} from "@app/state"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
class="tooltip tooltip-left fixed bottom-16 sm:bottom-4 right-2 sm:right-4 p-1 z-feature"
|
||||
class="tooltip tooltip-left fixed bottom-16 right-2 z-feature p-1 sm:bottom-4 sm:right-4"
|
||||
data-tip="Create an Event"
|
||||
on:click={createEvent}>
|
||||
<div class="btn btn-circle btn-primary flex h-12 w-12 items-center justify-center">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from 'svelte'
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {sortBy} from "@welshman/lib"
|
||||
import {createScroller} from '@lib/html'
|
||||
import {createScroller} from "@lib/html"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import PageBar from "@lib/components/PageBar.svelte"
|
||||
@@ -24,10 +24,10 @@
|
||||
|
||||
onMount(() => {
|
||||
const scroller = createScroller({
|
||||
element: element.closest('.max-h-screen')!,
|
||||
element: element.closest(".max-h-screen")!,
|
||||
onScroll: async () => {
|
||||
limit += 10
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
return () => scroller.stop()
|
||||
@@ -46,7 +46,7 @@
|
||||
<strong slot="title">Threads</strong>
|
||||
</PageBar>
|
||||
<div class="flex flex-grow flex-col gap-2 overflow-auto p-2">
|
||||
{#each threads.slice(0, 10) as { root, replies } (root.id)}
|
||||
{#each threads.slice(0, limit) as { root, replies } (root.id)}
|
||||
<ThreadItem {root} {replies} />
|
||||
{/each}
|
||||
<p class="flex h-10 items-center justify-center py-20">
|
||||
@@ -60,7 +60,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
class="tooltip tooltip-left fixed bottom-16 sm:bottom-4 right-2 sm:right-4 p-1 z-feature"
|
||||
class="tooltip tooltip-left fixed bottom-16 right-2 z-feature p-1 sm:bottom-4 sm:right-4"
|
||||
data-tip="Create an Event"
|
||||
on:click={createThread}>
|
||||
<div class="btn btn-circle btn-primary flex h-12 w-12 items-center justify-center">
|
||||
|
||||
Reference in New Issue
Block a user