diff options
| author | Adam Soltys <[email protected]> | 2024-08-22 20:33:45 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-08-22 20:33:45 -0700 |
| commit | b5510fb3620a39080d5d3c061f92d7a072d9131d (patch) | |
| tree | 51655169e7a95e409a54793500179b86a388b800 /src | |
| parent | 7964d39fa5766901065d9cca24e660edee20b593 (diff) | |
| download | coinos-ui-b5510fb3620a39080d5d3c061f92d7a072d9131d.tar.gz coinos-ui-b5510fb3620a39080d5d3c061f92d7a072d9131d.zip | |
no numpad if min == max withdrawable
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/Lnurlw.svelte | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte index b83e648f..211a0233 100644 --- a/src/components/Lnurlw.svelte +++ b/src/components/Lnurlw.svelte @@ -1,4 +1,5 @@ <script> + import { sats, f, s } from "$lib/utils"; import { t } from "$lib/translations"; import { enhance } from "$app/forms"; import Numpad from "$comp/Numpad.svelte"; @@ -18,10 +19,11 @@ } = data; $: rate = rates[currency]; - let amount = Math.round(maxWithdrawable / 1000), + let amount = Math.round(minWithdrawable / 1000), loading; let submit = () => (loading = true); + $: amountFiat = parseFloat(((amount * rate) / sats).toFixed(2)); </script> <div class="container px-4 mt-20 max-w-xl mx-auto"> @@ -39,7 +41,20 @@ </div> {/if} - <Numpad bind:amount {currency} bind:rate /> + {#if minWithdrawable === maxWithdrawable} + <div class="text-center font-bold text-2xl"> + <div> + {f(amountFiat, currency)} + </div> + <div> + <span class="text-secondary font-normal text-xl" + >⚡️{`${s(amount)}`}</span + > + </div> + </div> + {:else} + <Numpad bind:amount {currency} bind:rate /> + {/if} <form action="?/withdraw" method="POST" use:enhance on:submit={submit}> <input name="amount" value={amount} type="hidden" /> |
