resolve circular dependency

This commit is contained in:
Dexter 2022-04-11 10:04:21 +01:00
parent f721a21d0f
commit 9fcd79a1a3
12 changed files with 23 additions and 22 deletions

View File

@ -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';

View File

@ -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;

View File

@ -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 = () => {

View File

@ -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();

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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';

View File

@ -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 = () => {

View File

@ -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',
};

View File

@ -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
? [

View File

@ -1,4 +1,4 @@
import { Routes } from '../../router-config';
import { Routes } from '../../route-names';
import type { Result } from '../tendermint-transaction-response.d';
import {
TableWithTbody,