diff --git a/packages/bridge-ui-v2/src/components/NFTs/NFTInfoDialog.svelte b/packages/bridge-ui-v2/src/components/NFTs/NFTInfoDialog.svelte index 3354a674230..674f7c5dbad 100644 --- a/packages/bridge-ui-v2/src/components/NFTs/NFTInfoDialog.svelte +++ b/packages/bridge-ui-v2/src/components/NFTs/NFTInfoDialog.svelte @@ -20,6 +20,8 @@ export let nft: NFT; + export let srcChainId = $network?.id; + const dispatch = createEventDispatcher(); const selectNFT = () => { @@ -31,7 +33,7 @@ modalOpen = false; }; - $: currentChain = $network?.id; + $: currentChain = Number(srcChainId) || $network?.id; $: imgUrl = nft.metadata?.image || placeholderUrl; diff --git a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte index 3bbcd90bbeb..5c7d3c1530c 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte @@ -95,8 +95,8 @@ tokenId: Number(tokenIds[0]), type: item.tokenType, })) as NFT; - token = await fetchNFTImageUrl(token, Number(item.srcChainId), Number(item.destChainId)); + loading = false; } @@ -109,9 +109,11 @@ $: imgUrl = token?.metadata?.image || placeholderUrl; $: itemAmountDisplay = item.tokenType === TokenType.ERC721 ? '---' : item.amount; + + $: isNFT = [TokenType.ERC1155, TokenType.ERC721].includes(item.tokenType); -{#if [TokenType.ETH, TokenType.ERC20].includes(item.tokenType)} +{#if isNFT} @@ -120,48 +122,50 @@ tabindex="0" on:click={handleClick} on:keydown={handlePress} - class="flex text-primary-content md:h-[80px] h-[45px] w-full"> + class="flex text-primary-content items-center md:h-[80px] h-[45px] w-full relative"> {#if isDesktopOrLarger} -
+ + +
-
+
-
- {#if item.tokenType === TokenType.ERC20} - {formatUnits(item.amount ? item.amount : BigInt(0), item.decimals)} - {:else if item.tokenType === TokenType.ETH} - {formatEther(item.amount ? item.amount : BigInt(0))} - {/if} - {item.symbol} +
+ {itemAmountDisplay}
{:else} -
-
-
- - - - - -
-
- {formatEther(item.amount ? item.amount : BigInt(0))} - {item.symbol} -
-
-
+ TODO: mobile view {/if} - -
+
- -{:else if [TokenType.ERC1155, TokenType.ERC721].includes(item.tokenType)} +{:else if !isNFT} @@ -180,50 +184,48 @@ tabindex="0" on:click={handleClick} on:keydown={handlePress} - class="flex text-primary-content items-center md:h-[80px] h-[45px] w-full relative"> + class="flex text-primary-content md:h-[80px] h-[45px] w-full"> {#if isDesktopOrLarger} - - -
+
-
+
-
- {itemAmountDisplay} +
+ {#if item.tokenType === TokenType.ERC20} + {formatUnits(item.amount ? item.amount : BigInt(0), item.decimals)} + {:else if item.tokenType === TokenType.ETH} + {formatEther(item.amount ? item.amount : BigInt(0))} + {/if} + {item.symbol}
{:else} - TODO: mobile view +
+
+
+ + + + + +
+
+ {formatEther(item.amount ? item.amount : BigInt(0))} + {item.symbol} +
+
+
{/if} -
+ +
-