Add contact info to relay detail

This commit is contained in:
Jonathan Staab 2023-02-23 16:59:58 -06:00
parent 9ee96c45d7
commit 040e8955de
3 changed files with 29 additions and 22 deletions

View File

@ -1,10 +1,7 @@
# Current
- [ ] Add messages to database after visiting a chat/dm detail *shrugs shoulders*
- [ ] Move non-partials to pod file structure
- [ ] Await publish, show error if it fails or times out
- Show loading
- [ ] Test chat/dms
- [ ] Fix pagination
- [ ] Relays get marked as slow too easily now
# Next

View File

@ -295,10 +295,10 @@ const verifyNip05 = (pubkey, as) =>
)
database.routes.bulkPut(
createMap('id', urls.flatMap(url =>[
createMap('id', urls.flatMap(url => [
calculateRoute(pubkey, url, 'nip05', 'write', now()),
calculateRoute(pubkey, url, 'nip05', 'read', now()),
]))
]).filter(identity))
)
}
}

View File

@ -4,6 +4,7 @@
import {poll} from "src/util/misc"
import {between} from 'hurdak/lib/hurdak'
import Content from "src/partials/Content.svelte"
import Anchor from "src/partials/Anchor.svelte"
import Feed from "src/views/notes/Feed.svelte"
import database from 'src/agent/database'
import pool from 'src/agent/pool'
@ -57,21 +58,30 @@
{message}
</p>
</div>
{#if joined}
{#if $relays.length > 1}
<button
class="flex gap-3 items-center text-light"
on:click={() => user.removeRelay(relay.url)}>
<i class="fa fa-right-from-bracket" /> Leave
</button>
{/if}
{:else}
<button
class="flex gap-3 items-center text-light"
on:click={() => user.addRelay(relay.url)}>
<i class="fa fa-right-to-bracket" /> Join
</button>
{/if}
<div class="whitespace-nowrap flex gap-3 items-center flex-wrap">
{#if relay.contact}
<Anchor type="button-circle" href={`mailto:${relay.contact}`}>
<i class="fa fa-envelope" />
</Anchor>
{/if}
{#if joined}
{#if $relays.length > 1}
<Anchor
type="button"
class="flex gap-2 items-center rounded-full"
on:click={() => user.removeRelay(relay.url)}>
<i class="fa fa-right-from-bracket" /> Leave
</Anchor>
{/if}
{:else}
<Anchor
type="button"
class="flex gap-2 items-center rounded-full"
on:click={() => user.addRelay(relay.url)}>
<i class="fa fa-right-to-bracket" /> Join
</Anchor>
{/if}
</div>
</div>
{#if relay.description}
<p>{relay.description}</p>