diff --git a/apps/explorer/src/app/components/blocks/block-data.tsx b/apps/explorer/src/app/components/blocks/block-data.tsx index 5c41aae5d..af4be3e16 100644 --- a/apps/explorer/src/app/components/blocks/block-data.tsx +++ b/apps/explorer/src/app/components/blocks/block-data.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type { BlockMeta } from '../../routes/blocks/tendermint-blockchain-response'; -import { Routes } from '../../routes/router-config'; +import { Routes } from '../../routes/route-names'; import { Link } from 'react-router-dom'; import { SecondsAgo } from '../seconds-ago'; import { TableWithTbody, TableRow, TableCell } from '../table'; diff --git a/apps/explorer/src/app/components/header/header.tsx b/apps/explorer/src/app/components/header/header.tsx index 2a7762d9a..34e60eeeb 100644 --- a/apps/explorer/src/app/components/header/header.tsx +++ b/apps/explorer/src/app/components/header/header.tsx @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'; import { ThemeSwitcher, Icon } from '@vegaprotocol/ui-toolkit'; import { t } from '@vegaprotocol/react-helpers'; import { Search } from '../search'; -import { Routes } from '../../routes/router-config'; +import { Routes } from '../../routes/route-names'; interface ThemeToggleProps { toggleTheme: () => void; diff --git a/apps/explorer/src/app/components/jump-to-block/index.tsx b/apps/explorer/src/app/components/jump-to-block/index.tsx index 11230ff14..f6c6e5cfc 100644 --- a/apps/explorer/src/app/components/jump-to-block/index.tsx +++ b/apps/explorer/src/app/components/jump-to-block/index.tsx @@ -1,7 +1,7 @@ import { t } from '@vegaprotocol/react-helpers'; import React from 'react'; import { useNavigate } from 'react-router-dom'; -import { Routes } from '../../routes/router-config'; +import { Routes } from '../../routes/route-names'; import { JumpTo } from '../jump-to'; export const JumpToBlock = () => { diff --git a/apps/explorer/src/app/components/search/search.spec.tsx b/apps/explorer/src/app/components/search/search.spec.tsx index 32ed902a2..98cc1ef91 100644 --- a/apps/explorer/src/app/components/search/search.spec.tsx +++ b/apps/explorer/src/app/components/search/search.spec.tsx @@ -1,7 +1,7 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { Search } from './search'; import { MemoryRouter } from 'react-router-dom'; -import { Routes } from '../../routes/router-config'; +import { Routes } from '../../routes/route-names'; const mockedNavigate = jest.fn(); diff --git a/apps/explorer/src/app/components/search/search.tsx b/apps/explorer/src/app/components/search/search.tsx index a5d050062..3c33ffb47 100644 --- a/apps/explorer/src/app/components/search/search.tsx +++ b/apps/explorer/src/app/components/search/search.tsx @@ -3,7 +3,7 @@ import { FormGroup, Input, InputError, Button } from '@vegaprotocol/ui-toolkit'; import React from 'react'; import { useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; -import { Routes } from '../../routes/router-config'; +import { Routes } from '../../routes/route-names'; const TX_LENGTH = 64; diff --git a/apps/explorer/src/app/components/txs/txs-per-block.tsx b/apps/explorer/src/app/components/txs/txs-per-block.tsx index 83b0c6de2..3861c00ce 100644 --- a/apps/explorer/src/app/components/txs/txs-per-block.tsx +++ b/apps/explorer/src/app/components/txs/txs-per-block.tsx @@ -1,6 +1,6 @@ import useFetch from '../../hooks/use-fetch'; import type { ChainExplorerTxResponse } from '../../routes/types/chain-explorer-response'; -import { Routes } from '../../routes/router-config'; +import { Routes } from '../../routes/route-names'; import { DATA_SOURCES } from '../../config'; import { RenderFetched } from '../render-fetched'; import { TruncatedLink } from '../truncate/truncated-link'; diff --git a/apps/explorer/src/app/routes/blocks/id/block.spec.tsx b/apps/explorer/src/app/routes/blocks/id/block.spec.tsx index ed9843a97..031490766 100644 --- a/apps/explorer/src/app/routes/blocks/id/block.spec.tsx +++ b/apps/explorer/src/app/routes/blocks/id/block.spec.tsx @@ -1,7 +1,7 @@ import { Block } from './block'; import { render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; -import { Routes as RouteNames } from '../../router-config'; +import { Routes as RouteNames } from '../../route-names'; const blockId = 1085890; diff --git a/apps/explorer/src/app/routes/blocks/id/block.tsx b/apps/explorer/src/app/routes/blocks/id/block.tsx index 96b43f897..83fd2355a 100644 --- a/apps/explorer/src/app/routes/blocks/id/block.tsx +++ b/apps/explorer/src/app/routes/blocks/id/block.tsx @@ -13,7 +13,7 @@ import { } from '../../../components/table'; import { TxsPerBlock } from '../../../components/txs/txs-per-block'; import { Button } from '@vegaprotocol/ui-toolkit'; -import { Routes } from '../../router-config'; +import { Routes } from '../../route-names'; import { RenderFetched } from '../../../components/render-fetched'; import { HighlightedLink } from '../../../components/highlighted-link'; import { t } from '@vegaprotocol/react-helpers'; diff --git a/apps/explorer/src/app/routes/parties/home/index.tsx b/apps/explorer/src/app/routes/parties/home/index.tsx index 74c415272..700bca492 100644 --- a/apps/explorer/src/app/routes/parties/home/index.tsx +++ b/apps/explorer/src/app/routes/parties/home/index.tsx @@ -3,7 +3,7 @@ import { RouteTitle } from '../../../components/route-title'; import { JumpTo } from '../../../components/jump-to'; import { useNavigate } from 'react-router-dom'; -import { Routes } from '../../router-config'; +import { Routes } from '../../route-names'; import { t } from '@vegaprotocol/react-helpers'; export const JumpToParty = () => { diff --git a/apps/explorer/src/app/routes/route-names.tsx b/apps/explorer/src/app/routes/route-names.tsx new file mode 100644 index 000000000..0cf20aa2a --- /dev/null +++ b/apps/explorer/src/app/routes/route-names.tsx @@ -0,0 +1,12 @@ +export const Routes = { + HOME: '/', + TX: 'txs', + BLOCKS: 'blocks', + PARTIES: 'parties', + VALIDATORS: 'validators', + ASSETS: 'assets', + GENESIS: 'genesis', + GOVERNANCE: 'governance', + MARKETS: 'markets', + NETWORK_PARAMETERS: 'network-parameters', +}; diff --git a/apps/explorer/src/app/routes/router-config.tsx b/apps/explorer/src/app/routes/router-config.tsx index cecf1a2b7..60a3003a7 100644 --- a/apps/explorer/src/app/routes/router-config.tsx +++ b/apps/explorer/src/app/routes/router-config.tsx @@ -17,18 +17,7 @@ import { Txs as TxHome } from './txs/home'; import { PendingTxs } from './pending'; import flags from '../lib/flags'; import { t } from '@vegaprotocol/react-helpers'; -export const Routes = { - HOME: '/', - TX: 'txs', - BLOCKS: 'blocks', - PARTIES: 'parties', - VALIDATORS: 'validators', - ASSETS: 'assets', - GENESIS: 'genesis', - GOVERNANCE: 'governance', - MARKETS: 'markets', - NETWORK_PARAMETERS: 'network-parameters', -}; +import { Routes } from './route-names'; const partiesRoutes = flags.parties ? [ diff --git a/apps/explorer/src/app/routes/txs/id/tx-details.tsx b/apps/explorer/src/app/routes/txs/id/tx-details.tsx index 5b98a0845..4823741b4 100644 --- a/apps/explorer/src/app/routes/txs/id/tx-details.tsx +++ b/apps/explorer/src/app/routes/txs/id/tx-details.tsx @@ -1,4 +1,4 @@ -import { Routes } from '../../router-config'; +import { Routes } from '../../route-names'; import type { Result } from '../tendermint-transaction-response.d'; import { TableWithTbody,