hide NFT attributes if array is empty or has only items without value

This commit is contained in:
tom
2024-11-08 17:26:58 +01:00
committed by tom goriunov
parent e8c751d6f0
commit 4bed8be0ec
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -75,5 +75,6 @@ export default function attributesParser(attributes: Array<unknown>): Metadata['
trait_type: _upperFirst(trait || 'property'),
};
})
.filter((item) => item?.value)
.filter(Boolean);
}
@@ -123,7 +123,7 @@ const TokenInstanceMetadataInfo = ({ data, isLoading: isLoadingProp }: Props) =>
</DetailsInfoItem.Value>
</>
) }
{ metadata?.attributes && (
{ metadata?.attributes && metadata.attributes.length > 0 && (
<>
<DetailsInfoItem.Label
hint="NFT attributes"