Skip to content

Commit 3c50b52

Browse files
committed
feat(app): more refined token displayingj
1 parent 8004bfa commit 3c50b52

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ const hideZeroBalances = writable(true)
4848
</button>
4949
</div>
5050

51-
<div class="flex flex-col overflow-y-auto">
51+
<div class="flex flex-col overflow-y-auto gap-2 py-2">
5252
{#each intents.baseTokens ?? [] as token}
5353
{#if !$hideZeroBalances || token.balance !== "0"}
5454
<button
55-
class="px-2 py-1 hover:bg-neutral-400 dark:hover:bg-neutral-800 text-md flex justify-start items-center"
55+
class="px-4 py-1 hover:bg-neutral-400 dark:hover:bg-neutral-800 text-sm flex justify-start items-center"
5656
on:click={() => setAsset(token.denom)}
5757
>
58-
<Token chainId={$rawIntents.source} denom={token.denom} amount={token.balance} {chains}/>
58+
<Token stackedView highlightEnabled={false} chainId={$rawIntents.source} denom={token.denom} amount={token.balance} {chains}/>
5959
</button>
6060
{/if}
6161
{/each}

app/src/lib/components/TransferFrom/components/SelectedAsset.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export let onSelectAsset: Props["onSelectAsset"]
3030
on:click={onSelectAsset}
3131
>
3232
{#if $rawIntents.asset}
33-
<Token {chains} chainId={$rawIntents.source} denom={$rawIntents.asset}/>
33+
<Token highlightEnabled={false} showWrapping={false} {chains} chainId={$rawIntents.source} denom={$rawIntents.asset}/>
3434
{:else}
3535
Select Asset
3636
{/if}

app/src/lib/components/token.svelte

+14-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export let userAmount: string | null = null
2020
export let expanded = false
2121
export let highlightEnabled = true
2222
export let showWrapping = true
23+
export let stackedView = false
2324
2425
let tokenInfo = derived(
2526
tokenInfos,
@@ -57,6 +58,7 @@ onMount(() => {
5758
<span class={cn("inline-flex gap-1", highlightEnabled && $highlightItem?.kind === "token" && $highlightItem.denom === denom ? "bg-union-accent-300 dark:bg-union-accent-950" : "")}><b><Truncate
5859
value={token.combined.symbol} type="symbol"/></b>
5960
{#if showWrapping}
61+
{#if !stackedView}
6062
<div class="text-muted-foreground text-xs flex gap-1 items-center">
6163
{toDisplayName(chainId, chains)}
6264
{#each token.combined.wrapping as wrapping}
@@ -65,8 +67,19 @@ onMount(() => {
6567
chains,
6668
)}
6769
{/each}
68-
</div>{/if}</span>
70+
</div>{/if}{/if}</span>
6971
</div>
72+
{#if stackedView}
73+
<div class="text-muted-foreground text-xs flex gap-1 items-center -mt-1">
74+
{toDisplayName(chainId, chains)}
75+
{#each token.combined.wrapping as wrapping}
76+
<ArrowLeftIcon/>{toDisplayName(
77+
wrapping.unwrapped_chain.chain_id,
78+
chains,
79+
)}
80+
{/each}
81+
</div>
82+
{/if}
7083
{#if expanded}
7184
<div class="text-xs flex flex-col gap gap-4 text-muted-foreground">
7285
<section>

0 commit comments

Comments
 (0)