mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-18 06:44:27 +01:00
celebrate receive success
This commit is contained in:
3
src/assets/icons/close.svg
Normal file
3
src/assets/icons/close.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="48" height="48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m14 14 20 20m-20 0 20-20" stroke="#FFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 200 B |
BIN
src/assets/party.gif
Normal file
BIN
src/assets/party.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 269 KiB |
@@ -119,7 +119,7 @@ export function AmountEditable(props: { initialAmountSats: string, setAmountSats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const DIALOG_POSITIONER = "fixed inset-0 safe-top safe-bottom"
|
const DIALOG_POSITIONER = "fixed inset-0 safe-top safe-bottom z-50"
|
||||||
const DIALOG_CONTENT = "h-screen-safe p-4 bg-gray/50 backdrop-blur-md bg-black/80"
|
const DIALOG_CONTENT = "h-screen-safe p-4 bg-gray/50 backdrop-blur-md bg-black/80"
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
36
src/components/ReceiveSuccessModal.tsx
Normal file
36
src/components/ReceiveSuccessModal.tsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
import { Dialog } from "@kobalte/core";
|
||||||
|
import { JSX } from "solid-js";
|
||||||
|
import { Button, SmallHeader } from "~/components/layout";
|
||||||
|
import close from "~/assets/icons/close.svg";
|
||||||
|
|
||||||
|
const DIALOG_POSITIONER = "fixed inset-0 safe-top safe-bottom z-50"
|
||||||
|
const DIALOG_CONTENT = "h-screen-safe p-4 bg-gray/50 backdrop-blur-md bg-black/80"
|
||||||
|
|
||||||
|
|
||||||
|
export function ReceiveSuccessModal(props: { title: string, open: boolean, setOpen: (open: boolean) => void, children?: JSX.Element }) {
|
||||||
|
return (
|
||||||
|
<Dialog.Root isOpen={props.open} onOpenChange={(isOpen) => props.setOpen(isOpen)}>
|
||||||
|
<Dialog.Portal>
|
||||||
|
<div class={DIALOG_POSITIONER}>
|
||||||
|
<Dialog.Content class={DIALOG_CONTENT}>
|
||||||
|
<div class="flex justify-between items-center mb-2">
|
||||||
|
<Dialog.Title>
|
||||||
|
<SmallHeader>
|
||||||
|
{props.title}
|
||||||
|
</SmallHeader>
|
||||||
|
</Dialog.Title>
|
||||||
|
<Dialog.CloseButton class="p-2 hover:bg-white/10 rounded-lg active:bg-m-blue">
|
||||||
|
<img src={close} alt="Close" />
|
||||||
|
</Dialog.CloseButton>
|
||||||
|
</div>
|
||||||
|
<Dialog.Description class="flex flex-col gap-4">
|
||||||
|
{props.children}
|
||||||
|
<Button onClick={(_) => props.setOpen(false)}>Nice</Button>
|
||||||
|
</Dialog.Description>
|
||||||
|
</Dialog.Content>
|
||||||
|
</div>
|
||||||
|
</Dialog.Portal>
|
||||||
|
</Dialog.Root >
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -11,6 +11,10 @@ import { objectToSearchParams } from "~/utils/objectToSearchParams";
|
|||||||
import { useCopy } from "~/utils/useCopy";
|
import { useCopy } from "~/utils/useCopy";
|
||||||
import { JsonModal } from '~/components/JsonModal';
|
import { JsonModal } from '~/components/JsonModal';
|
||||||
import mempoolTxUrl from "~/utils/mempoolTxUrl";
|
import mempoolTxUrl from "~/utils/mempoolTxUrl";
|
||||||
|
import { ReceiveSuccessModal } from "~/components/ReceiveSuccessModal";
|
||||||
|
|
||||||
|
import party from '~/assets/party.gif';
|
||||||
|
import { Amount } from "~/components/Amount";
|
||||||
|
|
||||||
type OnChainTx = {
|
type OnChainTx = {
|
||||||
transaction: {
|
transaction: {
|
||||||
@@ -223,14 +227,23 @@ export default function Receive() {
|
|||||||
</Card>
|
</Card>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={receiveState() === "paid" && paidState() === "lightning_paid"}>
|
<Match when={receiveState() === "paid" && paidState() === "lightning_paid"}>
|
||||||
<JsonModal title="They paid with lightning" open={!!paidState()} data={paymentInvoice()} setOpen={(open: boolean) => { if (!open) clearAll() }} />
|
<ReceiveSuccessModal title="Payment Received!" open={!!paidState()} setOpen={(open: boolean) => { if (!open) clearAll() }}>
|
||||||
|
<div class="flex flex-col items-center gap-8">
|
||||||
|
<img src={party} alt="party" class="w-1/2 mx-auto" />
|
||||||
|
<Amount amountSats={paymentInvoice()?.amount_sats} showFiat />
|
||||||
|
</div>
|
||||||
|
</ReceiveSuccessModal>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={receiveState() === "paid" && paidState() === "onchain_paid"}>
|
<Match when={receiveState() === "paid" && paidState() === "onchain_paid"}>
|
||||||
<JsonModal title="They paid onchain" open={!!paidState()} data={paymentTx()} setOpen={(open: boolean) => { if (!open) clearAll() }}>
|
<ReceiveSuccessModal title="Payment Received!" open={!!paidState()} setOpen={(open: boolean) => { if (!open) clearAll() }}>
|
||||||
<a href={mempoolTxUrl(paymentTx()?.txid, "signet")} target="_blank" rel="noreferrer">
|
<div class="flex flex-col items-center gap-8">
|
||||||
Mempool Link
|
<img src={party} alt="party" class="w-1/2 mx-auto" />
|
||||||
</a>
|
<Amount amountSats={paymentTx()?.received} showFiat />
|
||||||
</JsonModal>
|
<a href={mempoolTxUrl(paymentTx()?.txid, "signet")} target="_blank" rel="noreferrer">
|
||||||
|
Mempool Link
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ReceiveSuccessModal>
|
||||||
</Match>
|
</Match>
|
||||||
</Switch>
|
</Switch>
|
||||||
</DefaultMain>
|
</DefaultMain>
|
||||||
|
|||||||
Reference in New Issue
Block a user