diff options
| author | Adam Soltys <[email protected]> | 2026-02-04 12:42:42 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 15:34:19 -0800 |
| commit | 78c201d8d9d2f3ec07f6ea36201977846e29ccd9 (patch) | |
| tree | 413d697c2cfa9d3e867c791e161183bad958ed86 /src/components/InvoiceData.svelte | |
| parent | 882c3bd3fd01b6001172c61e0d2227d962254c62 (diff) | |
| download | coinos-ui-78c201d8d9d2f3ec07f6ea36201977846e29ccd9.tar.gz coinos-ui-78c201d8d9d2f3ec07f6ea36201977846e29ccd9.zip | |
homepage design and currency toggling
Diffstat (limited to 'src/components/InvoiceData.svelte')
| -rw-r--r-- | src/components/InvoiceData.svelte | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/components/InvoiceData.svelte b/src/components/InvoiceData.svelte index 58348962..e0ec0f3e 100644 --- a/src/components/InvoiceData.svelte +++ b/src/components/InvoiceData.svelte @@ -1,7 +1,8 @@ <script> import Amount from "$comp/Amount.svelte"; - import { btc, copy, f, sat, s, sats, types } from "$lib/utils"; + import { btc, copy, f, sat, sats, types } from "$lib/utils"; + import { fiat } from "$lib/store"; let { showQr, link, @@ -66,17 +67,21 @@ {/if} {#each invoice.items as i} + {@const itemTotal = i.price * i.quantity} <div class="grid grid-cols-12 text-xl"> <div class="col-span-1 my-auto">{i.quantity}</div> <div class="mr-auto grow col-span-7 my-auto"> {i.name} </div> - <div class="col-span-2 font-semibold text-right my-auto"> - {f(i.price * i.quantity, currency)} - </div> - <div class="col-span-2 text-secondary text-right text-lg my-auto"> - {sat(btc(i.price * i.quantity, rate))} - </div> + {#if $fiat} + <div class="col-span-4 font-semibold text-right my-auto"> + {f(itemTotal, currency)} + </div> + {:else} + <div class="col-span-4 font-semibold text-right my-auto"> + {sat(btc(itemTotal, rate))} + </div> + {/if} </div> {/each} |
