Add basic lightning tip button

This commit is contained in:
styppo 2023-01-24 17:52:37 +00:00
parent 02f0a13f2b
commit 1bea3ab24b
No known key found for this signature in database
GPG Key ID: 3AAA685C50724C28
2 changed files with 21 additions and 6 deletions

View File

@ -13,6 +13,8 @@ export default class Profile {
url: metadata.nip05,
verified: null,
}
this.lud06 = metadata.lud06
this.lud16 = metadata.lud16
}
static from(event) {

View File

@ -23,7 +23,7 @@
<BaseIcon icon="messages" />
<q-tooltip>Send private message</q-tooltip>
</a>
<a>
<a :href="lightningLink" :class="{disabled: !lightningLink}">
<q-icon name="bolt" size="sm" />
<q-tooltip>Tip with Bitcoin Lightning</q-tooltip>
</a>
@ -165,6 +165,12 @@ export default defineComponent({
followers() {
return this.nostr.getFollowers(this.pubkey)
},
lightningLink() {
// TODO encode lud16 as lud06?
// TODO more protocols
const ln = this.profile?.lud06 || this.profile?.lud16
return ln ? `lightning:${ln}` : null
},
},
methods: {
loadMorePosts() {
@ -270,18 +276,25 @@ export default defineComponent({
.actions {
display: flex;
a {
text-decoration: none;
svg, i {
width: 24px;
height: 24px;
color: $color-light-gray;
fill: $color-light-gray;
//fill: $color-fg;
transition: 120ms ease;
}
&:hover svg, &:hover i {
fill: $color-fg;
color: $color-fg;
//fill: $color-primary;
&.disabled {
svg, i {
color: $color-dark-gray !important;
fill: $color-dark-gray !important;
}
}
&:hover {
svg, i {
fill: $color-fg;
color: $color-fg;
}
}
}
a + a {