Skip to content

Commit

Permalink
fix: properly handle empty collectibles/tokens tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Nov 13, 2024
1 parent 63fbbd0 commit 29a9f28
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function UserNetworkAssetListFeature({

{query.isLoading ? (
<UiLoader />
) : items?.length ? (
) : groups?.length ? (
<UiStack gap="lg">
{groups.map((group) => (
<UiStack key={group.token.id}>
Expand All @@ -86,8 +86,19 @@ export default function UserNetworkAssetListFeature({
))}
</UiStack>
) : (
<UiInfo message={`No ${type ? type : ''} assets found${cluster ? ` on cluster ${cluster}` : ''}.`} />
<UiInfo message={`No ${type ? typeName(type) : 'assets'} found${cluster ? ` on cluster ${cluster}` : ''}.`} />
)}
</UiStack>
)
}

function typeName(type: NetworkTokenType) {
switch (type) {
case NetworkTokenType.Fungible:
return 'tokens'
case NetworkTokenType.NonFungible:
return 'collectibles'
default:
return type
}
}

0 comments on commit 29a9f28

Please sign in to comment.