Skip to content

Commit

Permalink
Merge pull request #23 from aucch/txnumber
Browse files Browse the repository at this point in the history
Tx # in block list
  • Loading branch information
dahlia committed Aug 16, 2019
2 parents 4a658ea + 860a764 commit 339528f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api.graphql
Expand Up @@ -18,6 +18,9 @@ fragment TransactionCommon on Transaction {
query BlockList($offset: Int!, $limit: Int!) {
blocks(desc: true, offset: $offset, limit: $limit) {
...BlockCommon
transactions {
id
}
}
}

Expand Down
17 changes: 17 additions & 0 deletions src/pages/index.tsx
Expand Up @@ -141,6 +141,22 @@ const BlockList: React.FC<BlockListProps> = ({ blocks }) => {
data: 'string',
isPadded: true,
},
{
key: 'columnTxNumber',
name: 'Tx #',
fieldName: null,
minWidth: 5,
maxWidth: 20,
isRowHeader: true,
isResizable: true,
isSorted: false,
isSortedDescending: false,
data: 'number',
isPadded: true,
onRender: block => (
<>{block.transactions.length}</>
),
},
];
return (
<DetailsList
Expand All @@ -152,6 +168,7 @@ const BlockList: React.FC<BlockListProps> = ({ blocks }) => {
layoutMode={DetailsListLayoutMode.justified}
isHeaderVisible={true}
onItemInvoked={block => navigate(`/block/?${block.hash}`)}

/>
);
};
Expand Down

0 comments on commit 339528f

Please sign in to comment.