Add amber support

This commit is contained in:
Jon Staab
2024-10-21 14:09:57 -07:00
parent f93f47ffe7
commit 80de053cdd
15 changed files with 82 additions and 47 deletions
+26 -4
View File
@@ -3,9 +3,25 @@
import {nip19} from "nostr-tools"
import {ctx, sleep, sortBy, flatten} from "@welshman/lib"
import {feedFromFilter} from "@welshman/feeds"
import {NOTE, displayProfile, getListTags, getPubkeyTagValues, displayPubkey, getAncestorTags} from "@welshman/util"
import {
NOTE,
displayProfile,
getListTags,
getPubkeyTagValues,
displayPubkey,
getAncestorTags,
} from "@welshman/util"
import {deriveEvents} from "@welshman/store"
import {repository, userFollows, tagPubkey, follow, unfollow, deriveProfile, displayNip05, feedLoader} from "@welshman/app"
import {
repository,
userFollows,
tagPubkey,
follow,
unfollow,
deriveProfile,
displayNip05,
feedLoader,
} from "@welshman/app"
import {createScroller} from "@lib/html"
import {fly} from "@lib/transition"
import Link from "@lib/components/Link.svelte"
@@ -60,11 +76,17 @@
</div>
</div>
{#if getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
<button type="button" class="btn btn-neutral" on:click|preventDefault={() => unfollow(pubkey)}>
<button
type="button"
class="btn btn-neutral"
on:click|preventDefault={() => unfollow(pubkey)}>
Unfollow
</button>
{:else}
<button type="button" class="btn btn-primary" on:click|preventDefault={() => follow(tagPubkey(pubkey))}>
<button
type="button"
class="btn btn-primary"
on:click|preventDefault={() => follow(tagPubkey(pubkey))}>
Follow
</button>
{/if}