diff --git a/src/routes/[network]/(account)/account/+layout.svelte b/src/routes/[network]/(account)/account/+layout.svelte index a838b0ded..ca60cb323 100644 --- a/src/routes/[network]/(account)/account/+layout.svelte +++ b/src/routes/[network]/(account)/account/+layout.svelte @@ -2,8 +2,14 @@ import { page } from '$app/stores'; import { Stack } from '$lib/components/layout'; import PillGroup from '$lib/components/navigation/pillgroup.svelte'; + import Pageheader from '$lib/components/pageheader.svelte'; - const { data, children } = $props(); + import type { UnicoveContext } from '$lib/state/client.svelte'; + import { getContext } from 'svelte'; + + const context = getContext('state'); + + const { data, children } = $props(); const tabOptions = $derived.by(() => { const network = String(data.network); @@ -15,22 +21,21 @@ ]; }); - let currentTab = $derived($page.url.pathname.split('/').slice(2)[3]); - - // Derive the active state of each destination + let currentTab = $derived($page.url.pathname.split('/').pop() || 'overview'); let options = $derived( tabOptions.map((option) => ({ ...option, - active: option.href.split('/').slice(2)[2] === currentTab + active: (option.href.split('/').pop() || 'overview') === currentTab })) ); + + const subtitle = $derived(context.account?.name ? String(context.account.name) : ''); -
- -

Account

-
+ + + -
-{@render children()} + {@render children()} + diff --git a/src/routes/[network]/(account)/account/balances/+page.svelte b/src/routes/[network]/(account)/account/balances/+page.svelte index 8a0c9736b..329ba4d5d 100644 --- a/src/routes/[network]/(account)/account/balances/+page.svelte +++ b/src/routes/[network]/(account)/account/balances/+page.svelte @@ -1,4 +1,79 @@ -
Blances
\ No newline at end of file + + + +
+
+ {#if systemTokenMeta} + LOGO + {/if} +
+ +

Total {totalTokenValue?.symbol.name} Balance

+

{totalTokenValue?.value}

+
+
+
+ + +
+
$
+ +

Total {totalUsdValue?.symbol.name} Balance

+

{totalUsdValue?.value}

+
+
+
+
+ + {#snippet transferIntent(data: TokenBalance)} +
+ +
+ {/snippet} +
+
diff --git a/src/routes/[network]/(account)/account/components/tokens.svelte b/src/routes/[network]/(account)/account/components/tokens.svelte new file mode 100644 index 000000000..c66ee1c31 --- /dev/null +++ b/src/routes/[network]/(account)/account/components/tokens.svelte @@ -0,0 +1,43 @@ + + +
+
+
Token
+
Amount
+
+
+
+ {#snippet row(name: string, balance: TokenBalance, transferable: boolean = false)} +
+
+
+ {#if balance.metadata?.logo} + LOGO + {/if} +
+ {name} +
+
+ {balance.asset.value} +
+
+ {#if transferable && transferIntent} + {@render transferIntent(balance)} + {/if} +
+
+ {/snippet} + + {#each tokenBalances as item} + {@render row(item.asset.symbol.name, item, true)} + {/each} +
+