From ac1df72de63ae3e731d5b82e0cca652cbc7324a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Riquelme=20Guzm=C3=A1n?= Date: Wed, 21 Feb 2024 00:16:47 -0300 Subject: [PATCH 1/2] fix: non fungible label --- src/types/explorer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/explorer.ts b/src/types/explorer.ts index 72c1990..eb233cf 100644 --- a/src/types/explorer.ts +++ b/src/types/explorer.ts @@ -186,7 +186,7 @@ export type ExplorerContext = { export const enum ResourceTypes { FUNGIBLE = "fungible", - NON_FUNGIBLE = "nonFungible", + NON_FUNGIBLE = "nonfungible", PERMISSIONED_GENERIC = "permissionedGeneric", PERMISSIONLESS_GENERIC = "permissionlessGeneric", } From 1cfff4dd6371a58a53dc3e974317406415fa3a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Riquelme=20Guzm=C3=A1n?= Date: Wed, 21 Feb 2024 00:24:42 -0300 Subject: [PATCH 2/2] chore: removing amount if transfer is non fungible --- src/utils/Helpers.tsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/utils/Helpers.tsx b/src/utils/Helpers.tsx index f7d963a..20c53d9 100644 --- a/src/utils/Helpers.tsx +++ b/src/utils/Helpers.tsx @@ -279,12 +279,18 @@ export const renderAmountValue = ( amount: string, resourceID: string, fromDomainInfo: SharedConfigDomain | undefined, -): string => { - if (type !== ResourceTypes.PERMISSIONLESS_GENERIC && resourceID !== "") { +): string | undefined => { + if (type === ResourceTypes.PERMISSIONLESS_GENERIC) { + return "Contract call" + } + + if (type === ResourceTypes.FUNGIBLE && resourceID !== "") { return `${amount} ${getResourceInfo(resourceID, fromDomainInfo!)}` } - return "Contract call" + if (type === ResourceTypes.NON_FUNGIBLE && resourceID !== "") { + return `${getResourceInfo(resourceID, fromDomainInfo!)}` + } } export const renderFormatedConvertedAmount = (type: ResourceTypes, usdValue: number): string => { @@ -317,16 +323,15 @@ export const accountLinks = (type: DomainTypes, accountId: string, domainExplore } export const filterTransfers = (transfers: Transfer[], sharedConfig: SharedConfigDomain[]) => { - - return transfers.filter((transfer) => { + return transfers.filter(transfer => { const { fromDomainId, toDomainId } = transfer - + const fromDomainInfo = getDomainData(fromDomainId, sharedConfig) const toDomainInfo = getDomainData(toDomainId, sharedConfig) - if(!fromDomainInfo || !toDomainInfo) { + if (!fromDomainInfo || !toDomainInfo) { return } - + return transfer }) }