Skip to content

Commit

Permalink
relay stuff styling fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Sep 15, 2023
1 parent 9d8243b commit e88a077
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions src/lib/cards/Article.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@
else replaceSelf(nextTab);
}
function openRelay(relay: string, ev: MouseEvent) {
console.log('navigating to', relay);
function openRelay(relay: string) {
let relayTab: RelayTab = { id: next(), type: 'relay', data: relay };
if (ev.button === 1) createChild(relayTab);
else replaceSelf(relayTab);
createChild(relayTab);
}
onMount(() => {
Expand Down Expand Up @@ -122,12 +120,17 @@
<!-- Content -->
{@html parse(event?.content)}

<div class="mt-4 text-indigo-900 drop-shadow">
{#each getRelaysForEvent(event) as r}
<span on:mouseup|preventDefault={openRelay.bind(null, r)} class="block cursor-pointer"
>{new URL(r).host}</span
>
{/each}
<div class="mt-4">
<h2 class="m-0 p-0">Found on relays</h2>
<ul class="list-disc m-0 pt-2 px-5">
{#each getRelaysForEvent(event) as r}
<li class="p-0 m-0 cursor-pointer">
<a on:mouseup|preventDefault={openRelay.bind(null, r)}>
{new URL(r).host}
</a>
</li>
{/each}
</ul>
</div>
{/if}
</article>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cards/Relay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<div class="font-sans mx-auto p-6 lg:max-w-4xl lg:pt-6 lg:pb-28">
<div class="prose">
<h1 class="mb-0">{tab.data}</h1>
<h1 class="mb-0 break-all">{tab.data}</h1>
</div>
{#each results as result}
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
Expand Down

0 comments on commit e88a077

Please sign in to comment.