From 6e07dc9bc31558606633c4164eb5f1e828e01741 Mon Sep 17 00:00:00 2001 From: Maxime Laforet Date: Wed, 1 Nov 2023 13:05:07 +0000 Subject: [PATCH] feat: UX/UI enhancements for Transaction history page --- .../dashboard/shared/TxsHistoryTable.svelte | 145 ++++++++++++++ src/lib/components/shared/ArrowUpRight.svelte | 6 +- src/lib/components/transactions/Paging.svelte | 130 ++++++------ src/routes/transactions/+page.svelte | 185 +++++++----------- 4 files changed, 284 insertions(+), 182 deletions(-) create mode 100644 src/lib/components/dashboard/shared/TxsHistoryTable.svelte diff --git a/src/lib/components/dashboard/shared/TxsHistoryTable.svelte b/src/lib/components/dashboard/shared/TxsHistoryTable.svelte new file mode 100644 index 00000000..992f7d24 --- /dev/null +++ b/src/lib/components/dashboard/shared/TxsHistoryTable.svelte @@ -0,0 +1,145 @@ + + + + + + Amount (BTC) + Address + Type + Height + Actions + + + {#each sbtcEvents.results as event} + + {satsToBitcoin(event.payloadData.amountSats)} + + + + +
+ {#if getType(event.payloadData.eventType) === 'deposit'} + + {getType(event.payloadData.eventType)} + + {:else} + + {getType(event.payloadData.eventType)} + + {/if} +
+ +
+
+
+ {fmtNumber(event.payloadData.burnBlockHeight)} + + + View details + + +
+ {/each} +
+
+ +
+
+

+ Showing + 1 + to + 10 + of + 97 + results +

+
+ +
+ diff --git a/src/lib/components/shared/ArrowUpRight.svelte b/src/lib/components/shared/ArrowUpRight.svelte index 2df58677..4356a860 100644 --- a/src/lib/components/shared/ArrowUpRight.svelte +++ b/src/lib/components/shared/ArrowUpRight.svelte @@ -8,7 +8,7 @@ let anchorClass = clazz + ' rounded-md bg-black flex items-center justify-center
- - + +
diff --git a/src/lib/components/transactions/Paging.svelte b/src/lib/components/transactions/Paging.svelte index 31a9304f..5be33c67 100644 --- a/src/lib/components/transactions/Paging.svelte +++ b/src/lib/components/transactions/Paging.svelte @@ -1,78 +1,80 @@ {#if totalEvents > 0 && inited} -
-
- - - Previous - - - - Next - - - -
-
+ + + Previous + + + + Next + + + {/if} diff --git a/src/routes/transactions/+page.svelte b/src/routes/transactions/+page.svelte index b37dec21..b1662e0e 100644 --- a/src/routes/transactions/+page.svelte +++ b/src/routes/transactions/+page.svelte @@ -1,79 +1,79 @@ @@ -82,78 +82,33 @@ onMount(async () => {
-
-
-
-
Transaction History
- {#if inited} -
-
-
{(sbtcEvents) ? sbtcEvents.events : ''} Deposits & withdrawals
-
- {#if !myDepositsFilter}
{/if} -
- toggleMine()} > - {#if myDepositsFilter} - my txs - {:else} - all txs - {/if} -
-
+
+
+
Transaction History
+ {#if inited} + + +
+
-
-
-
-
-
Height
-
Address
-
Amount
- -
Type
-
Actions
-
-
-
- {#each sbtcEvents.results as event} -
-
{fmtNumber(event.payloadData.burnBlockHeight)}
- -
{satsToBitcoin(event.payloadData.amountSats)}
- -
-
- - {getType(event.payloadData.eventType)} -
-
- -
-
- -
- {/each} -
-
- + + +
+
-
- {/if} +
+
+ {:else} + + + + + + + + + {/if}
-
-
+