Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: non fungible label #160

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/types/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down
21 changes: 13 additions & 8 deletions src/utils/Helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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
})
}
Loading