From cc82bf4c7a1fd6fef56f2cf6af69c1e6c8a7e0aa Mon Sep 17 00:00:00 2001 From: Micaela Estabillo Date: Fri, 23 Aug 2024 14:49:16 -0700 Subject: [PATCH] chore: add AssetPicker fallback text --- .../asset-picker/asset-picker.tsx | 115 ++++++++++-------- .../asset-picker/index.scss | 5 + 2 files changed, 68 insertions(+), 52 deletions(-) diff --git a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx index a555d154fdd2..b3f3b038ba78 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx @@ -184,63 +184,74 @@ export function AssetPicker({ }} title={handleAssetPickerTitle()} > - - - - selectedNetwork?.ticker?.includes(tickerSubstring), - )?.[1] - } - borderColor={ - primaryTokenImage - ? BorderColor.borderMuted - : BorderColor.borderDefault - } + {asset ? ( + + + + selectedNetwork?.ticker?.includes(tickerSubstring), + )?.[1] + } + borderColor={ + primaryTokenImage + ? BorderColor.borderMuted + : BorderColor.borderDefault + } + /> + } + > + - } - > - - - + + - - - {formattedSymbol} - - {isNFT && asset?.tokenId && ( + - # - {String(asset.tokenId).length < ELLIPSIFY_LENGTH - ? asset.tokenId - : ellipsify(String(asset.tokenId), 6, 4)} + {formattedSymbol} - )} - - + {isNFT && asset?.tokenId && ( + + # + {String(asset.tokenId).length < ELLIPSIFY_LENGTH + ? asset.tokenId + : ellipsify(String(asset.tokenId), 6, 4)} + + )} + + + ) : ( + + {t('swapSelectToken')} + + )} ); diff --git a/ui/components/multichain/asset-picker-amount/asset-picker/index.scss b/ui/components/multichain/asset-picker-amount/asset-picker/index.scss index d30ce8c016d7..8218c7f3a1c3 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker/index.scss +++ b/ui/components/multichain/asset-picker-amount/asset-picker/index.scss @@ -25,4 +25,9 @@ opacity: 1; cursor: not-allowed; } + + &__fallback{ + text-wrap: nowrap; + padding-left: 8px; + } }