Commit 12d7b900 authored by tom's avatar tom

transactions_count for Scroll batch could be null

parent 5d262cea
...@@ -27,7 +27,7 @@ export type ScrollL2TxnBatch = { ...@@ -27,7 +27,7 @@ export type ScrollL2TxnBatch = {
confirmation_transaction: ScrollL2TxnBatchConfirmationTransaction; confirmation_transaction: ScrollL2TxnBatchConfirmationTransaction;
start_block: number; start_block: number;
end_block: number; end_block: number;
transaction_count: number; transaction_count: number | null;
data_availability: { data_availability: {
batch_data_container: 'in_blob4844' | 'in_calldata'; batch_data_container: 'in_blob4844' | 'in_calldata';
}; };
......
...@@ -115,6 +115,8 @@ const ScrollL2TxnBatchDetails = ({ query }: Props) => { ...@@ -115,6 +115,8 @@ const ScrollL2TxnBatchDetails = ({ query }: Props) => {
} }
</DetailedInfo.ItemValue> </DetailedInfo.ItemValue>
{ typeof data.transaction_count === 'number' ? (
<>
<DetailedInfo.ItemLabel <DetailedInfo.ItemLabel
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
hint="Number of transactions in this batch" hint="Number of transactions in this batch"
...@@ -126,6 +128,8 @@ const ScrollL2TxnBatchDetails = ({ query }: Props) => { ...@@ -126,6 +128,8 @@ const ScrollL2TxnBatchDetails = ({ query }: Props) => {
{ data.transaction_count.toLocaleString() } transaction{ data.transaction_count === 1 ? '' : 's' } { data.transaction_count.toLocaleString() } transaction{ data.transaction_count === 1 ? '' : 's' }
</Link> </Link>
</DetailedInfo.ItemValue> </DetailedInfo.ItemValue>
</>
) : null }
<DetailedInfo.ItemLabel <DetailedInfo.ItemLabel
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
......
...@@ -104,6 +104,8 @@ const ScrollL2TxnBatchesListItem = ({ item, isLoading }: Props) => { ...@@ -104,6 +104,8 @@ const ScrollL2TxnBatchesListItem = ({ item, isLoading }: Props) => {
</Link> </Link>
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
{ typeof item.transaction_count === 'number' ? (
<>
<ListItemMobileGrid.Label isLoading={ isLoading }>Txn count</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Txn count</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<Link <Link
...@@ -115,6 +117,8 @@ const ScrollL2TxnBatchesListItem = ({ item, isLoading }: Props) => { ...@@ -115,6 +117,8 @@ const ScrollL2TxnBatchesListItem = ({ item, isLoading }: Props) => {
{ item.transaction_count.toLocaleString() } { item.transaction_count.toLocaleString() }
</Link> </Link>
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
</>
) : null }
</ListItemMobileGrid.Container> </ListItemMobileGrid.Container>
); );
......
...@@ -87,12 +87,14 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => { ...@@ -87,12 +87,14 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
</Link> </Link>
</TableCell> </TableCell>
<TableCell verticalAlign="middle" isNumeric> <TableCell verticalAlign="middle" isNumeric>
{ typeof item.transaction_count === 'number' ? (
<Link <Link
href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) } href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) }
loading={ isLoading } loading={ isLoading }
> >
{ item.transaction_count.toLocaleString() } { item.transaction_count.toLocaleString() }
</Link> </Link>
) : 'N/A' }
</TableCell> </TableCell>
</TableRow> </TableRow>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment