From 98426f94f8b03522f11a66abbdd8640900cf300b Mon Sep 17 00:00:00 2001 From: Dexter Date: Fri, 18 Feb 2022 14:27:14 +0000 Subject: [PATCH] fix blocks page --- .../app/hooks/use-tendermint-websocket.tsx | 2 +- .../src/app/routes/blocks/home/index.tsx | 14 +++++------ .../explorer/src/app/routes/router-config.tsx | 14 +++++------ package.json | 3 ++- yarn.lock | 24 +++++++------------ 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/apps/explorer/src/app/hooks/use-tendermint-websocket.tsx b/apps/explorer/src/app/hooks/use-tendermint-websocket.tsx index 6d9bc4ef2..93f0ad7bd 100644 --- a/apps/explorer/src/app/hooks/use-tendermint-websocket.tsx +++ b/apps/explorer/src/app/hooks/use-tendermint-websocket.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useTendermintWebsocketContext } from '../contexts/websocket/tendermint-websocket-context'; -import { uuid } from 'uuidv4'; +import { v4 as uuid } from 'uuid'; export interface TendermintWebsocketQuery { query: string; diff --git a/apps/explorer/src/app/routes/blocks/home/index.tsx b/apps/explorer/src/app/routes/blocks/home/index.tsx index 5f69bbea4..742569360 100644 --- a/apps/explorer/src/app/routes/blocks/home/index.tsx +++ b/apps/explorer/src/app/routes/blocks/home/index.tsx @@ -1,8 +1,8 @@ -import { DATA_SOURCES } from "../../../config"; -import useFetch from "../../../hooks/use-fetch"; -import { NewBlockMessage } from "../tendermint-new-block"; -import { TendermintBlockchainResponse } from "../tendermint-blockchain-response"; -import { useTendermintWebsocket } from "../../../hooks/use-tendermint-websocket"; +import { DATA_SOURCES } from '../../../config'; +import useFetch from '../../../hooks/use-fetch'; +import { NewBlockMessage } from '../tendermint-new-block'; +import { TendermintBlockchainResponse } from '../tendermint-blockchain-response'; +import { useTendermintWebsocket } from '../../../hooks/use-tendermint-websocket'; const MAX_BLOCKS = 10; @@ -27,12 +27,12 @@ const Blocks = () => {

-
{JSON.stringify(data, null, "  ")}
+
{JSON.stringify(data, null, '  ')}

Blocks streamed in


-
{JSON.stringify(blocks, null, "  ")}
+
{JSON.stringify(blocks, null, '  ')}
); diff --git a/apps/explorer/src/app/routes/router-config.tsx b/apps/explorer/src/app/routes/router-config.tsx index 09ae4bc80..c29c8096e 100644 --- a/apps/explorer/src/app/routes/router-config.tsx +++ b/apps/explorer/src/app/routes/router-config.tsx @@ -1,5 +1,5 @@ import Assets from './assets'; -import Blocks from './blocks'; +import BlockPage from './blocks'; import Governance from './governance'; import Home from './home'; import Markets from './markets'; @@ -11,7 +11,7 @@ import Validators from './validators'; import Genesis from './genesis'; import NetworkParameters from './network-parameters'; import { Block } from './blocks/id'; -import { Blocks as BlocksHome } from './blocks/home'; +import { Blocks } from './blocks/home'; import { Tx } from './txs/id'; import { Txs as TxHome } from './txs/home'; @@ -53,16 +53,16 @@ const routerConfig = [ { path: Routes.BLOCKS, name: 'Blocks', - element: , + element: , children: [ + { + index: true, + element: , + }, { path: ':block', element: , }, - { - index: true, - element: , - }, ], }, { diff --git a/package.json b/package.json index 22533a1e5..69e1b4458 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "dependencies": { "@apollo/client": "^3.5.8", "@nrwl/next": "13.8.1", + "@types/uuid": "^8.3.4", "apollo": "^2.33.9", "core-js": "^3.6.5", "env-cmd": "^10.1.0", @@ -26,7 +27,7 @@ "react-use-websocket": "^3.0.0", "regenerator-runtime": "0.13.7", "tslib": "^2.0.0", - "uuidv4": "^6.2.12" + "uuid": "^8.3.2" }, "devDependencies": { "@babel/core": "7.12.13", diff --git a/yarn.lock b/yarn.lock index 8d6596144..b8effedb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4422,10 +4422,10 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== -"@types/uuid@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" - integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== +"@types/uuid@^8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" + integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== "@types/webpack-env@^1.16.0": version "1.16.3" @@ -17306,23 +17306,15 @@ uuid-browser@^3.1.0: resolved "https://registry.yarnpkg.com/uuid-browser/-/uuid-browser-3.1.0.tgz#0f05a40aef74f9e5951e20efbf44b11871e56410" integrity sha1-DwWkCu90+eWVHiDvv0SxGHHlZBA= -uuid@8.3.2, uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -uuidv4@^6.2.12: - version "6.2.12" - resolved "https://registry.yarnpkg.com/uuidv4/-/uuidv4-6.2.12.tgz#e8c1d1d733c3fa4963d4610b8a3a09b4ec58ca96" - integrity sha512-UnN4ThIYWhv3ZUE8UwDnnCvh4JafCNu+sQkxmLyjCVwK3rjLfkg3DYiEv6oCMDIAIVEDP4INg4kX/C5hKaRzZA== - dependencies: - "@types/uuid" "8.3.1" - uuid "8.3.2" +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache@2.3.0, v8-compile-cache@^2.0.3: version "2.3.0"