diff options
| author | secondl1ght <[email protected]> | 2022-07-29 21:29:18 -0600 |
|---|---|---|
| committer | secondl1ght <[email protected]> | 2022-07-29 21:29:18 -0600 |
| commit | 9414eb90e4dba3c69db76f2cfafb60515a5b3a90 (patch) | |
| tree | 206f5c46c7cde19c328106daac9cd65e559f2872 /src/routes/receive.svelte | |
| parent | 81a073638e03f57abd9016ce246940e602e8366d (diff) | |
| download | coinos-ui-9414eb90e4dba3c69db76f2cfafb60515a5b3a90.tar.gz coinos-ui-9414eb90e4dba3c69db76f2cfafb60515a5b3a90.zip | |
start hooking up invoice screen
Diffstat (limited to 'src/routes/receive.svelte')
| -rw-r--r-- | src/routes/receive.svelte | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/routes/receive.svelte b/src/routes/receive.svelte index 338bc06c..095a2ba3 100644 --- a/src/routes/receive.svelte +++ b/src/routes/receive.svelte @@ -2,7 +2,7 @@ // in the future we will want to allow users to set their fiat currency in the settings import { AppHeader, Icon } from '$comp'; import { goto } from '$app/navigation'; - import { invoiceAmount, rate } from '$lib/store'; + import { invoiceAmount, invoiceAmountFiat, rate } from '$lib/store'; let useFiat = true; let amountFiat = 0; @@ -10,6 +10,9 @@ let message = ''; $: $invoiceAmount = parseInt(amountSats === 0 ? amountFiat / ($rate / 100000000) : amountSats); + $: $invoiceAmountFiat = parseInt( + amountFiat === 0 ? amountSats * ($rate / 100000000) : amountFiat + ); $: amountSatsFormatted = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 }).format( amountSats ); @@ -63,6 +66,7 @@ amountSats = amountSats.slice(0, amountSats.length - 1); if (amountSats.length === 0) { amountSats = 0; + amountFiat = 0; } } } else if (value !== '<' && parseInt(amountSats + value) > 100000000) { @@ -77,8 +81,8 @@ <AppHeader /> <!-- step 1 input amount and generate QR code --> -{#if $rate} - <div class="flex justify-center items-center mt-20 mb-3 px-3"> +<div class="flex justify-center items-center mt-20 mb-3 px-3"> + {#if $rate} <div class="space-y-5"> <!-- amounts --> <div class="text-center"> @@ -165,11 +169,7 @@ > </div> </div> - </div> -{:else} - <div class="px-3"> - <div - class="w-full md:w-[300px] h-[475px] md:h-[485px] animate-pulse bg-gray-400 mt-20 mb-3 mx-auto rounded-xl" - /> - </div> -{/if} + {:else} + <div class="w-full md:w-[300px] h-[475px] md:h-[485px] animate-pulse bg-gray-400 rounded-xl" /> + {/if} +</div> |
