From a421da7ca5e67972d833e36c5bd1cbf6bb76a477 Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Tue, 2 Aug 2022 14:33:58 -0600 Subject: add transactions page --- src/routes/[username]/dashboard.svelte | 2 +- src/routes/[username]/support.svelte | 2 +- src/routes/[username]/transactions.svelte | 48 ++++++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/routes/[username]/dashboard.svelte b/src/routes/[username]/dashboard.svelte index 4c0e4cfc..6f38a812 100644 --- a/src/routes/[username]/dashboard.svelte +++ b/src/routes/[username]/dashboard.svelte @@ -36,7 +36,7 @@
-

Dashboard

+

Dashboard

Bitcoin Price: {$rate ? btcPrice : 'fetching rate...'} diff --git a/src/routes/[username]/support.svelte b/src/routes/[username]/support.svelte index 7dd254c1..f974bd80 100644 --- a/src/routes/[username]/support.svelte +++ b/src/routes/[username]/support.svelte @@ -8,7 +8,7 @@
-

Support

+

Support

diff --git a/src/routes/[username]/transactions.svelte b/src/routes/[username]/transactions.svelte index 1935b156..bbcc0c23 100644 --- a/src/routes/[username]/transactions.svelte +++ b/src/routes/[username]/transactions.svelte @@ -1,5 +1,51 @@ - +{#if $user} + + +
+

+ Transaction History +

+ +
+
+

AMOUNT

+

TIME

+
+ +
+ {#if transactions.length} + {#each transactions as tx} +
+
+ {new Intl.NumberFormat('en-US', { + style: 'currency', + currency: 'USD' + }).format(tx.amount * (tx.rate / 100000000))} + + + ({new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 }).format(tx.amount)} + SATS) + +
+ +
+ {new Date(tx.createdAt).toLocaleDateString(undefined, { dateStyle: 'medium' })} +
+
+ {/each} + {:else} +

No transactions yet.

+ {/if} +
+
+
+{/if} -- cgit v1.2.3