1
1
<script lang =" ts" >
2
+ import { Switch } from " $lib/components/ui/switch"
3
+ import { Label } from " $lib/components/ui/label"
2
4
import { page } from " $app/stores"
3
5
import request from " graphql-request"
4
6
import { transfersBySourceHashBaseQueryDocument } from " $lib/graphql/queries/transfer-details.ts"
@@ -8,7 +10,7 @@ import { URLS } from "$lib/constants"
8
10
import * as Card from " $lib/components/ui/card/index.ts"
9
11
import { toIsoString } from " $lib/utilities/date"
10
12
import LoadingLogo from " $lib/components/loading-logo.svelte"
11
- import { derived } from " svelte/store"
13
+ import { derived , writable } from " svelte/store"
12
14
import { raise } from " $lib/utilities"
13
15
import Trace from " $lib/components/trace.svelte"
14
16
import type { Chain } from " $lib/types"
@@ -19,6 +21,7 @@ import { formatUnits } from "viem"
19
21
import PacketPath from " ./packet-path.svelte"
20
22
import Token from " ./token.svelte"
21
23
import Address from " ./address.svelte"
24
+ import { showTokenDetails } from " $lib/stores/user"
22
25
23
26
// prefix a source with 0x if not there for cosmos tx hashes
24
27
const source = $page .params .source .startsWith (" 0x" )
@@ -91,31 +94,28 @@ let processedTransfers = derived(
91
94
/>
92
95
</Card .Header >
93
96
<Card .Content class =" flex flex-col gap-8" >
94
- <section class =" flex justify-between" >
95
- <div >
96
- <div class =" flex flex-col gap-6" >
97
- {#if transfer .base_amount && transfer .base_token }
98
- <Token
99
- expanded =" true"
100
- highlightEnabled ={false }
101
- amount ={transfer .base_amount }
102
- denom ={transfer .base_token }
103
- chainId ={transfer .source_chain_id }
104
- {chains }
105
- />
106
- {/if }
107
- {#if " quote_amount" in transfer && transfer .quote_amount && " quote_token" in transfer && transfer .quote_token }
108
- <Token
109
- expanded =" true"
110
- highlightEnabled ={false }
111
- amount ={transfer .quote_amount }
112
- denom ={transfer .quote_token }
113
- chainId ={transfer .destination_chain_id }
114
- {chains }
115
- />
116
- {/if }
117
- </div >
118
- </div >
97
+ <section class ={cn (! $showTokenDetails ? " items-center text-xl" : " " , " flex flex-col gap-6" )}>
98
+ {#if transfer .base_amount && transfer .base_token }
99
+ <Token
100
+ expanded ={$showTokenDetails }
101
+ showWrapping ={$showTokenDetails }
102
+ highlightEnabled ={false }
103
+ amount ={transfer .base_amount }
104
+ denom ={transfer .base_token }
105
+ chainId ={transfer .source_chain_id }
106
+ {chains }
107
+ />
108
+ {/if }
109
+ {#if $showTokenDetails && " quote_amount" in transfer && transfer .quote_amount && " quote_token" in transfer && transfer .quote_token }
110
+ <Token
111
+ expanded ={$showTokenDetails }
112
+ highlightEnabled ={false }
113
+ amount ={transfer .quote_amount }
114
+ denom ={transfer .quote_token }
115
+ chainId ={transfer .destination_chain_id }
116
+ {chains }
117
+ />
118
+ {/if }
119
119
</section >
120
120
121
121
<section >
0 commit comments