Skip to content

Commit

Permalink
[dag block] Added conditional judgment for different networks
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Jun 26, 2024
1 parent 67bf5bb commit f9afc30
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/modules/Blocks/components/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,24 +259,32 @@ class Index extends PureComponent<IndexProps, IndexState> {
<CommonLink key={header.author} path={`/${network}/address/${header.author}`} title={header.author} />],
[t('block.Difficulty'), formatNumber(header.difficulty_number)],
[t('common.GasUsed'), formatNumber(header.gas_used)],
[t('block.ParentHash'),
<CommonLink key={header.parent_hash} path={`/${network}/blocks/detail/${header.parent_hash}`}
title={header.parent_hash} />
],
[t('block.ParentsHash'),
header.parents_hash.map((hash: string) => (
<CommonLink key={hash} path={`/${network}/blocks/detail/${hash}`} title={hash} />
))
],
[t('block.DaaScore'),formatNumber(block.daa_score)],
[t('block.HeightgroupIndex'),formatNumber(block.heightgroup_index)],
[t('block.MergedBlueset'),
block.merged_blueset.map((hash: string) => (
<CommonLink key={hash} path={`/${network}/blocks/detail/${hash}`} title={hash} />
))
],
];

if (network === 'vega' || network === 'halley') {
columns.push(
[t('block.ParentsHash'),
header.parents_hash.map((hash: string) => (
<CommonLink key={hash} path={`/${network}/blocks/detail/${hash}`} title={hash} />
))
],
[t('block.DaaScore'),formatNumber(block.daa_score)],
[t('block.HeightgroupIndex'),formatNumber(block.heightgroup_index)],
[t('block.MergedBlueset'),
block.merged_blueset.map((hash: string) => (
<CommonLink key={hash} path={`/${network}/blocks/detail/${hash}`} title={hash} />
))
]
);
} else {
columns.push(
[t('block.ParentHash'),
<CommonLink key={header.parent_hash} path={`/${network}/blocks/detail/${header.parent_hash}`}
title={header.parent_hash} />
]
);
}

return (
<PageView
id={header.block_hash}
Expand Down

0 comments on commit f9afc30

Please sign in to comment.