forked from coracle/flotilla
Fix tagging, relay search
This commit is contained in:
@@ -108,6 +108,10 @@
|
|||||||
@apply flex flex-col gap-4;
|
@apply flex flex-col gap-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ellipsize {
|
||||||
|
@apply text-ellipsis overflow-hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@apply m-auto w-full max-w-3xl p-4 sm:p-8 md:p-12;
|
@apply m-auto w-full max-w-3xl p-4 sm:p-8 md:p-12;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,11 +32,13 @@
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="column gap-2" bind:this={element}>
|
<div class="fixed left-6 right-6 top-6">
|
||||||
<label class="input input-bordered flex w-full items-center gap-2">
|
<label class="input input-bordered flex w-full items-center gap-2">
|
||||||
<Icon icon="magnifer" />
|
<Icon icon="magnifer" />
|
||||||
<input bind:value={term} class="grow" type="text" placeholder="Search for relays..." />
|
<input bind:value={term} class="grow" type="text" placeholder="Search for relays..." />
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="overflow-auto column gap-2 h-[50vh] mt-16" bind:this={element}>
|
||||||
{#each $relaySearch
|
{#each $relaySearch
|
||||||
.searchValues(term)
|
.searchValues(term)
|
||||||
.filter(url => !$relays.includes(url))
|
.filter(url => !$relays.includes(url))
|
||||||
|
|||||||
@@ -13,19 +13,19 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="card2 card2-sm bg-alt column gap-2">
|
<div class="card2 card2-sm bg-alt column gap-2">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center gap-4 justify-between">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2 ellipsize">
|
||||||
<Icon icon="remote-controller-minimalistic" />
|
<Icon icon="remote-controller-minimalistic" />
|
||||||
{displayRelayUrl(url)}
|
<p class="ellipsize">{displayRelayUrl(url)}</p>
|
||||||
</div>
|
</div>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
{#if $relay?.profile?.description}
|
{#if $relay?.profile?.description}
|
||||||
<p>{$relay?.profile.description}</p>
|
<p class="ellipsize">{$relay?.profile.description}</p>
|
||||||
{/if}
|
{/if}
|
||||||
<span class="flex items-center gap-1 text-sm">
|
<span class="flex items-center gap-1 text-sm whitespace-nowrap">
|
||||||
{#if $relay?.profile?.contact}
|
{#if $relay?.profile?.contact}
|
||||||
<Link external class="underline" href={$relay.profile.contact}
|
<Link external class="underline ellipsize" href={$relay.profile.contact}
|
||||||
>{displayUrl($relay.profile.contact)}</Link>
|
>{displayUrl($relay.profile.contact)}</Link>
|
||||||
•
|
•
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
export let props = {}
|
export let props = {}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="bg-alt modal-box overflow-visible" transition:fly={{duration: 100}}>
|
<div class="bg-alt modal-box overflow-y-auto overflow-visible" transition:fly={{duration: 100}}>
|
||||||
<svelte:component this={component} {...props} />
|
<svelte:component this={component} {...props} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,27 +61,27 @@ export const getEditorTags = (editor: Editor) => {
|
|||||||
attrs.tag.replace(/^#/, "").toLowerCase(),
|
attrs.tag.replace(/^#/, "").toLowerCase(),
|
||||||
])
|
])
|
||||||
|
|
||||||
const naddrTags = findNodes("naddr", json).map(({kind, pubkey, identifier, relays = []}: any) => {
|
const naddrTags = findNodes("naddr", json).map(({attrs: {kind, pubkey, identifier, relays = []}}: any) => {
|
||||||
const address = new Address(kind, pubkey, identifier).toString()
|
const address = new Address(kind, pubkey, identifier).toString()
|
||||||
|
|
||||||
return ["q", address, ctx.app.router.fromRelays(relays).getUrl(), pubkey]
|
return ["q", address, ctx.app.router.fromRelays(relays).getUrl(), pubkey]
|
||||||
})
|
})
|
||||||
|
|
||||||
const neventTags = findNodes("nevent", json).map(({id, author, relays = []}: any) => [
|
const neventTags = findNodes("nevent", json).map(({attrs: {id, author, relays = []}}: any) => [
|
||||||
"q",
|
"q",
|
||||||
id,
|
id,
|
||||||
ctx.app.router.fromRelays(relays).getUrl(),
|
ctx.app.router.fromRelays(relays).getUrl(),
|
||||||
author || "",
|
author || "",
|
||||||
])
|
])
|
||||||
|
|
||||||
const mentionTags = findNodes("nprofile", json).map(({pubkey, relays = []}: any) => [
|
const mentionTags = findNodes("nprofile", json).map(({attrs: {pubkey, relays = []}}: any) => [
|
||||||
"p",
|
"p",
|
||||||
pubkey,
|
pubkey,
|
||||||
ctx.app.router.fromRelays(relays).getUrl(),
|
ctx.app.router.fromRelays(relays).getUrl(),
|
||||||
"",
|
"",
|
||||||
])
|
])
|
||||||
|
|
||||||
const imetaTags = findNodes("image", json).map(({src, sha256}: any) => [
|
const imetaTags = findNodes("image", json).map(({attrs: {src, sha256}}: any) => [
|
||||||
"imeta",
|
"imeta",
|
||||||
`url ${src}`,
|
`url ${src}`,
|
||||||
`x ${sha256}`,
|
`x ${sha256}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user