Zaps with POW UX
This commit is contained in:
parent
2720854b72
commit
f1bfc2f3a6
@ -17,6 +17,7 @@ import { useWallet } from "Wallet";
|
|||||||
import useLogin from "Hooks/useLogin";
|
import useLogin from "Hooks/useLogin";
|
||||||
import { generateRandomKey } from "Login";
|
import { generateRandomKey } from "Login";
|
||||||
import { ZapPoolController } from "ZapPoolController";
|
import { ZapPoolController } from "ZapPoolController";
|
||||||
|
import AsyncButton from "Element/AsyncButton";
|
||||||
|
|
||||||
import messages from "./messages";
|
import messages from "./messages";
|
||||||
|
|
||||||
@ -121,8 +122,8 @@ export default function SendSats(props: SendSatsProps) {
|
|||||||
setAmount(a);
|
setAmount(a);
|
||||||
};
|
};
|
||||||
|
|
||||||
async function loadInvoice() {
|
async function loadInvoice(): Promise<void> {
|
||||||
if (!amount || !handler || !publisher) return null;
|
if (!amount || !handler || !publisher) return;
|
||||||
|
|
||||||
let zap: NostrEvent | undefined;
|
let zap: NostrEvent | undefined;
|
||||||
if (author && zapType !== ZapType.NonZap) {
|
if (author && zapType !== ZapType.NonZap) {
|
||||||
@ -250,7 +251,7 @@ export default function SendSats(props: SendSatsProps) {
|
|||||||
</div>
|
</div>
|
||||||
{zapTypeSelector()}
|
{zapTypeSelector()}
|
||||||
{(amount ?? 0) > 0 && (
|
{(amount ?? 0) > 0 && (
|
||||||
<button type="button" className="zap-action" onClick={() => loadInvoice()}>
|
<AsyncButton className="zap-action" onClick={() => loadInvoice()}>
|
||||||
<div className="zap-action-container">
|
<div className="zap-action-container">
|
||||||
<Icon name="zap" />
|
<Icon name="zap" />
|
||||||
{target ? (
|
{target ? (
|
||||||
@ -259,7 +260,7 @@ export default function SendSats(props: SendSatsProps) {
|
|||||||
<FormattedMessage {...messages.ZapSats} values={{ n: formatShort(amount) }} />
|
<FormattedMessage {...messages.ZapSats} values={{ n: formatShort(amount) }} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</AsyncButton>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user