diff --git a/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx b/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx index f1bc0d67e00..faf99fbdb7a 100644 --- a/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx +++ b/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx @@ -506,34 +506,6 @@ function TokenInfoScreen(props: { }); const token = tokenQuery.data; - if (tokenQuery.isPending) { - return ( - - - - ); - } - - if (!token) { - return ( - - - Token not found - - - ); - } - const isNativeToken = isNativeTokenAddress(props.tokenAddress); const explorerLink = isNativeToken ? `https://thirdweb.com/${props.chainId}` @@ -543,7 +515,7 @@ function TokenInfoScreen(props: { {/* Header */} @@ -552,125 +524,136 @@ function TokenInfoScreen(props: { - {/* Content */} - - {/* name + icon */} - + {tokenQuery.isPending ? ( + + + + ) : !token ? ( + - Name + Token not found - - - - } - /> - - {token.name} + + ) : ( + + {/* name + icon */} + + + Name + + + + } + /> + + {token.name} + + - - {/* symbol */} - - - {/* price */} - {"prices" in token && ( - - )} + {/* symbol */} + + + {/* price */} + {"prices" in token && ( + + )} - {/* market cap */} - {!!token.marketCapUsd && ( - - )} + {/* market cap */} + {!!token.marketCapUsd && ( + + )} - {/* volume 24h */} - {!!token.volume24hUsd && ( - - )} + {/* volume 24h */} + {!!token.volume24hUsd && ( + + )} - {/* address + link */} - - - Contract Address - + {/* address + link */} + + + Contract Address + - - {!isNativeToken && ( - - )} + + {!isNativeToken && ( + + )} - - {isNativeToken - ? "Native Currency" - : shortenAddress(props.tokenAddress)} - + + {isNativeToken + ? "Native Currency" + : shortenAddress(props.tokenAddress)} + + - + )} ); }