Settings page and UI tweaks #200
@ -9,7 +9,6 @@ import Copy from "Element/Copy";
|
|||||||
import useWebln from "Hooks/useWebln";
|
import useWebln from "Hooks/useWebln";
|
||||||
|
|
||||||
interface LNURLService {
|
interface LNURLService {
|
||||||
allowsNostr?: boolean
|
|
||||||
nostrPubkey?: HexKey
|
nostrPubkey?: HexKey
|
||||||
minSendable?: number,
|
minSendable?: number,
|
||||||
maxSendable?: number,
|
maxSendable?: number,
|
||||||
@ -128,7 +127,7 @@ export default function LNURLTip(props: LNURLTipProps) {
|
|||||||
let url = ''
|
let url = ''
|
||||||
const amountParam = `amount=${Math.floor(amount * 1000)}`
|
const amountParam = `amount=${Math.floor(amount * 1000)}`
|
||||||
const commentParam = comment ? `&comment=${encodeURIComponent(comment)}` : ""
|
const commentParam = comment ? `&comment=${encodeURIComponent(comment)}` : ""
|
||||||
if (payService.allowsNostr && payService.nostrPubkey && author) {
|
if (payService.nostrPubkey && author) {
|
||||||
const ev = await publisher.zap(author, note, comment)
|
const ev = await publisher.zap(author, note, comment)
|
||||||
const nostrParam = ev && `&nostr=${encodeURIComponent(JSON.stringify(ev.ToObject()))}`
|
const nostrParam = ev && `&nostr=${encodeURIComponent(JSON.stringify(ev.ToObject()))}`
|
||||||
url = `${payService.callback}?${amountParam}${commentParam}${nostrParam}`;
|
url = `${payService.callback}?${amountParam}${commentParam}${nostrParam}`;
|
||||||
@ -240,7 +239,7 @@ export default function LNURLTip(props: LNURLTipProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultTitle = payService?.allowsNostr === true ? "⚡️ Send Zap!" : "⚡️ Send sats";
|
const defaultTitle = payService?.nostrPubkey ? "⚡️ Send Zap!" : "⚡️ Send sats";
|
||||||
if (!show) return null;
|
if (!show) return null;
|
||||||
return (
|
return (
|
||||||
<Modal onClose={onClose}>
|
<Modal onClose={onClose}>
|
||||||
|
Loading…
Reference in New Issue
Block a user