diff --git a/packages/bridge-ui-v2/src/components/Bridge/NFTBridgeSteps/ImportStep.svelte b/packages/bridge-ui-v2/src/components/Bridge/NFTBridgeSteps/ImportStep.svelte index c6fe84559a7..0c8d4548507 100644 --- a/packages/bridge-ui-v2/src/components/Bridge/NFTBridgeSteps/ImportStep.svelte +++ b/packages/bridge-ui-v2/src/components/Bridge/NFTBridgeSteps/ImportStep.svelte @@ -322,6 +322,7 @@ Automatic NFT Input
diff --git a/packages/bridge-ui-v2/src/components/Transactions/StatusFilterDropdown.svelte b/packages/bridge-ui-v2/src/components/Transactions/StatusFilterDropdown.svelte index 51ae133b64c..ac1df983405 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/StatusFilterDropdown.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/StatusFilterDropdown.svelte @@ -8,6 +8,10 @@ export let selectedStatus: MessageStatus | null = null; + let flipped = false; + + let iconFlipperComponent: IconFlipper; + let menuOpen = false; const options = [ @@ -25,6 +29,7 @@ const toggleMenu = () => { menuOpen = !menuOpen; + flipped = !flipped; }; $: menuClasses = classNames( @@ -44,7 +49,13 @@ ? options.find((option) => option.value === selectedStatus)?.label : $t('transactions.filter.all')} - + {#if menuOpen} diff --git a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte index b902f26d7e9..fec5e6a8ec2 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte @@ -15,6 +15,7 @@ import { type NFT, TokenType } from '$libs/token'; import { fetchNFTImageUrl } from '$libs/token/fetchNFTImageUrl'; import { getTokenWithInfoFromAddress } from '$libs/token/getTokenWithInfoFromAddress'; + import { truncateString } from '$libs/util/truncateString'; import ChainSymbolName from './ChainSymbolName.svelte'; import InsufficientFunds from './InsufficientFunds.svelte'; @@ -192,8 +193,10 @@ {:else} nft
-
{token?.name}
-
{token?.metadata?.name}
+
{token?.name ? truncateString(token?.name, 15) : ''}
+
+ {token?.metadata?.name ? truncateString(token?.metadata?.name, 15) : ''} +
{token?.tokenId}
{/if} diff --git a/packages/bridge-ui-v2/src/libs/token/fetchNFTImageUrl.ts b/packages/bridge-ui-v2/src/libs/token/fetchNFTImageUrl.ts index 89bfe629c47..b632eb8bd48 100644 --- a/packages/bridge-ui-v2/src/libs/token/fetchNFTImageUrl.ts +++ b/packages/bridge-ui-v2/src/libs/token/fetchNFTImageUrl.ts @@ -1,6 +1,6 @@ import axios from 'axios'; -import { checkForAdblocker } from '$libs/util/checkForAdblock'; +// import { checkForAdblocker } from '$libs/util/checkForAdblock'; import { extractIPFSCidFromUrl } from '$libs/util/extractIPFSCidFromUrl'; import { fetchNFTMetadata } from '$libs/util/fetchNFTMetadata'; import { getFileExtension } from '$libs/util/getFileExtension'; @@ -38,10 +38,6 @@ const useGateway = (url: string, tokenId: number): string | null => { const fetchImageUrl = async (url: string, tokenId: number): Promise => { try { - // Check if the URL is blocked by an adblocker - const isBlocked = await checkForAdblocker(url); - if (isBlocked) throw new Error(`URL is blocked by adblocker: ${url}`); - await axios.get(url); return url; } catch { @@ -53,21 +49,15 @@ const fetchImageUrl = async (url: string, tokenId: number): Promise => { } }; +// Main function to fetch NFT image URL export const fetchNFTImageUrl = async (token: NFT): Promise => { try { - const metadata = token.metadata || (await fetchNFTMetadata(token)); + const metadata = token.metadata || (await fetchNFTMetadata(token)); // Assume fetchNFTMetadata is imported if (!metadata?.image) throw new Error('No image found'); - const url = safeParseUrl(metadata.image); + const url = safeParseUrl(metadata.image); // Assume safeParseUrl is defined elsewhere if (!url) throw new Error(`Invalid image URL: ${metadata.image}`); - // If the URL is blocked by an adblocker, log an error and return the original token - const isBlocked = await checkForAdblocker(url); - if (isBlocked) { - log(`URL is blocked by adblocker: ${url}`); - return token; - } - const imageUrl = await fetchImageUrl(url, token.tokenId); token.metadata = { ...metadata,