From 380da842ffdb597eebb88f217f89a9268cbfaf6a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 28 Nov 2024 08:04:46 -0800 Subject: currency locale --- src/components/Amount.svelte | 52 +++++++------ src/components/Balance.svelte | 4 +- src/components/InvoiceData.svelte | 35 +-------- src/components/LocaleSelector.svelte | 1 - src/components/Numpad.svelte | 3 +- src/components/PasswordInput.svelte | 5 +- src/components/SetAmount.svelte | 10 ++- src/lib/utils.ts | 86 ++++++++++++++++++++-- .../(app)/[username]/(profile)/+layout.svelte | 1 - src/routes/(app)/[username]/receive/+page.svelte | 21 +++++- src/routes/(app)/invoice/[id]/+page.svelte | 4 +- .../(app)/payments/[...page]/+page.server.ts | 23 ++++-- src/routes/(app)/payments/[...page]/+page.svelte | 40 +++++----- src/routes/(app)/reset/[code]/+page.svelte | 37 ++-------- .../(app)/send/lightning/[payreq]/+page.svelte | 3 +- 15 files changed, 195 insertions(+), 130 deletions(-) (limited to 'src') diff --git a/src/components/Amount.svelte b/src/components/Amount.svelte index de432400..46aa2d1b 100644 --- a/src/components/Amount.svelte +++ b/src/components/Amount.svelte @@ -1,31 +1,35 @@ -
-

-
- {s(amount)} -
- - {#if tip} -
-
+
+{#if amount} +
+

+
-
{s(tip)}
+ >{s(amount)}
- {/if} -

-

- {f(toFiat(amount, rate), currency)} - {#if tip} - - + {f(toFiat(tip, rate), currency)} - - {/if} -

-
+ + {#if tip} +
+
+
+ +
{s(tip)}
+
+ {/if} +

+

+ {f(toFiat(amount, rate), currency, locale)} + {#if tip} + + + {f(toFiat(tip, rate), currency, locale)} + + {/if} +

+
+{/if} diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte index 3451a9af..33597c18 100644 --- a/src/components/Balance.svelte +++ b/src/components/Balance.svelte @@ -1,6 +1,6 @@
@@ -218,7 +222,7 @@
- {f(Math.abs(p.amount) * (p.rate / sats), p.currency)} + {f(Math.abs(p.amount) * (p.rate / sats), p.currency, loc(user))} {#if p.tip} @@ -322,15 +326,15 @@ >{$t("payments.income")} - {tipsIn ? f(tipsIn, c) : "-"} - {totalIn ? f(totalIn, c) : "-"} + {tipsIn ? f(tipsIn, c, loc(user)) : "-"} + {totalIn ? f(totalIn, c, loc(user)) : "-"} {$t("payments.expenditure")} - {tipsOut ? f(tipsOut, c) : "-"} - {totalOut ? f(totalOut, c) : "-"} + {tipsOut ? f(tipsOut, c, loc(user)) : "-"} + {totalOut ? f(totalOut, c, loc(user)) : "-"} {/each}
diff --git a/src/routes/(app)/reset/[code]/+page.svelte b/src/routes/(app)/reset/[code]/+page.svelte index 144c73a9..df9d1144 100644 --- a/src/routes/(app)/reset/[code]/+page.svelte +++ b/src/routes/(app)/reset/[code]/+page.svelte @@ -1,5 +1,6 @@
@@ -31,37 +31,10 @@ {/if}
-
- - {#if revealPassword} - - {:else} - - {/if} - -
+
A new seed phrase will be generated for your account. You'll need to diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte index 2d981326..a4474fe0 100644 --- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte +++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte @@ -1,4 +1,5 @@
-- cgit v1.2.3