From 0b712099aff8874549509e1cadf5ee037992fe75 Mon Sep 17 00:00:00 2001 From: DimitarTAtanasov <86364535+DimitarTAtanasov@users.noreply.github.com> Date: Fri, 8 Nov 2024 18:25:53 +0200 Subject: [PATCH] dev -> main (#136) * Fix overflow table (#134) * Change log --------- Co-authored-by: Denis Dinkov --- src/utils/rpc/getBlockDetails.ts | 2 +- src/views/blockDetails/blockBody/index.tsx | 271 +++++++++++---------- src/views/blockDetails/index.tsx | 3 +- 3 files changed, 141 insertions(+), 135 deletions(-) diff --git a/src/utils/rpc/getBlockDetails.ts b/src/utils/rpc/getBlockDetails.ts index 351f37ae..d0985602 100644 --- a/src/utils/rpc/getBlockDetails.ts +++ b/src/utils/rpc/getBlockDetails.ts @@ -207,7 +207,7 @@ export const getBlockDetailsWithRawClient = async ({ try { events = storageCodec.dec(storageValue) as Awaited>; } catch (error) { - console.log('Could not decode storage value'); + console.log('Could not decode storage value!'); } // Initialize timestamp variable diff --git a/src/views/blockDetails/blockBody/index.tsx b/src/views/blockDetails/blockBody/index.tsx index 5300c7b3..ffa9e2d6 100644 --- a/src/views/blockDetails/blockBody/index.tsx +++ b/src/views/blockDetails/blockBody/index.tsx @@ -8,6 +8,7 @@ import { import { Icon } from '@components/icon'; import { ModalJSONViewer } from '@components/modals/modalJSONViewer'; +import { PDScrollArea } from '@components/pdScrollArea'; import { Tabs } from '@components/tabs'; import { ToolTip } from '@components/tooltTip'; import { cn } from '@utils/helpers'; @@ -85,7 +86,7 @@ export const BlockBody = (props: BlockBodyProps) => { ]); return ( -
+
{
- - - - - - - - - - - - - - - - - - - - { - visibleExtrinsics.map((extrinsic: IMappedBlockExtrinsic, extrinsicIndex: number) => { - const extrinsicTimestamp = extrinsic.timestamp || blockTimestamp; - const timeAgo = extrinsicTimestamp && formatDistanceToNowStrict( - new Date(extrinsicTimestamp), - { addSuffix: true }, - ); - return ( + +
Extrinsic IDHeightTimeResultAction -
+ + + + + + + + + + + + + + + + + + + { + visibleExtrinsics.map((extrinsic: IMappedBlockExtrinsic, extrinsicIndex: number) => { + const extrinsicTimestamp = extrinsic.timestamp || blockTimestamp; + const timeAgo = extrinsicTimestamp && formatDistanceToNowStrict( + new Date(extrinsicTimestamp), + { addSuffix: true }, + ); + return ( + + + + + + + + + ); + }) + } + +
Extrinsic IDHeightTimeResultAction +
{extrinsic.id}{blockNumber}{timeAgo} + + + {extrinsic.extrinsicData.method.section} + {' '} + ( + {extrinsic.extrinsicData.method.method} + ) + + + + + + +
+ + { + bodyData.extrinsics.length > 3 && ( +
+ +
+ ) + } +
+
+ + + + + + + + + + + + + + + + + { + visibleEvents.map((event: IMappedBlockEvent, eventIndex: number) => ( - - - + - ); - }) - } - -
Event IDActionType +
{extrinsic.id}{blockNumber}{timeAgo} - + {blockNumber} + - + {eventIndex} - {extrinsic.extrinsicData.method.section} + {event.event.type} {' '} ( - {extrinsic.extrinsicData.method.method} + {event.event.value.type} ) {event.phase.type} @@ -169,89 +252,11 @@ export const BlockBody = (props: BlockBodyProps) => {
- { - bodyData.extrinsics.length > 3 && ( -
- -
- ) - } -
-
- - - - - - - - - - - - - - - - { - visibleEvents.map((event: IMappedBlockEvent, eventIndex: number) => ( - - - - - - - )) - } - -
Event IDActionType -
- {blockNumber} - - - {eventIndex} - - {event.event.type} - {' '} - ( - {event.event.value.type} - ) - {event.phase.type} - - - - - -
+ )) + } + + + {bodyData.events.length > 3 && (
)}
-
+ -
+
); }; diff --git a/src/views/blockDetails/index.tsx b/src/views/blockDetails/index.tsx index 7743734c..f561a40a 100644 --- a/src/views/blockDetails/index.tsx +++ b/src/views/blockDetails/index.tsx @@ -6,6 +6,7 @@ import { import { useParams } from 'react-router-dom'; import { Icon } from '@components/icon'; +import { Loader } from '@components/loader'; import { PageHeader } from '@components/pageHeader'; import { PDLink } from '@components/pdLink'; import { useStoreChain } from '@stores'; @@ -85,7 +86,7 @@ const BlockDetails = () => { ]); if (!blockData) { - return 'Loading...'; + return ; } return (