From 8b130ed8390c2ab0e97b896028a1a24704ee1505 Mon Sep 17 00:00:00 2001 From: Maxime Laforet Date: Mon, 27 Nov 2023 22:36:51 +0000 Subject: [PATCH] feat: UX/UI enhancements for Transaction history page (#294) * feat: UX/UI enhancements for Transaction history page * chore: cleaning --- .../dashboard/shared/TxsHistoryTable.svelte | 145 ++++++++++++++ src/lib/components/shared/ArrowUpRight.svelte | 6 +- src/lib/components/transactions/Paging.svelte | 130 +++++++------ src/routes/transactions/+page.svelte | 183 ++++++------------ 4 files changed, 270 insertions(+), 194 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..e45a2c09 100644 --- a/src/routes/transactions/+page.svelte +++ b/src/routes/transactions/+page.svelte @@ -1,79 +1,53 @@ @@ -82,78 +56,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}
-
-
+