diff --git a/frontend/src/components/NFTItem/NFTItem.module.css b/frontend/src/components/NFTItem/NFTItem.module.css index 64dd07d..4367f75 100644 --- a/frontend/src/components/NFTItem/NFTItem.module.css +++ b/frontend/src/components/NFTItem/NFTItem.module.css @@ -136,6 +136,9 @@ } .assetList { + display: flex; + flex-direction: column; + gap: 10px; width: 100%; } @@ -145,6 +148,17 @@ font-size: 12px; } +.assetName { + display: flex; + gap: 10px; + align-items: center; +} +.assetName img { + width: 20px; + height: 20px; + border-radius: 50%; +} + .asset .value { display: flex; gap: 10px; diff --git a/frontend/src/components/NFTItem/index.tsx b/frontend/src/components/NFTItem/index.tsx index 8a612d1..dabcdb6 100644 --- a/frontend/src/components/NFTItem/index.tsx +++ b/frontend/src/components/NFTItem/index.tsx @@ -33,7 +33,8 @@ const NFTItem: React.FC = ({ nft, chainId }) => { chainId, }) - const mechBalances = data ? [data.native, ...data.erc20s] : [] + const mechNativeBalance = data ? data.native : null + const mechErc20Balances = data ? data.erc20s : [] const { deployed } = useDeployMech(getNFTContext(nft), chainId) const metadata = JSON.parse(nft.metadata || "{}") const name = nft.name || metadata?.name || "..." @@ -98,20 +99,30 @@ const NFTItem: React.FC = ({ nft, chainId }) => { -
+
{mechBalancesError &&

Failed to load assets

} {mechBalancesLoading && } - - {mechBalances.length === 0 &&

No assets found

}
    - {mechBalances.map((balance, index) => ( + {!mechBalancesLoading && !mechBalancesError && mechNativeBalance && ( +
  • +
    {mechNativeBalance.name}
    +
    +

    + {formatUnits( + BigInt(mechNativeBalance.balance), + mechNativeBalance.decimals || 0 + )} +

    +

    {mechNativeBalance.symbol}

    +
    +
  • + )} + {mechErc20Balances.map((balance, index) => (
  • -
    {balance.name}
    +
    + {`logo +
    {balance.name}
    +

    {formatUnits(BigInt(balance.balance), balance.decimals || 0)}