forked from coracle/flotilla
Lint/format
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user