-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-lazy-load' of github.com:lanchana/bitcore
- Loading branch information
Showing
8 changed files
with
143 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, {lazy, Suspense} from 'react'; | ||
import {Navigate, Route, Routes} from 'react-router-dom'; | ||
import Home from './pages'; | ||
const Blocks = lazy(() => import('./pages/blocks')); | ||
const Block = lazy(() => import('./pages/block')); | ||
const TransactionHash = lazy(() => import('./pages/transaction')); | ||
const Address = lazy(() => import('./pages/address')); | ||
const Search = lazy(() => import('./pages/search')); | ||
|
||
function Routing() { | ||
return ( | ||
<Suspense> | ||
<Routes> | ||
<Route path='/' element={<Home />} /> | ||
<Route path='/:currency/:network/blocks' element={<Blocks />} /> | ||
<Route path='/:currency/:network/block/:block' element={<Block />} /> | ||
<Route path='/:currency/:network/tx/:tx' element={<TransactionHash />} /> | ||
<Route path='/:currency/:network/address/:address' element={<Address />} /> | ||
<Route path='/search' element={<Search />} /> | ||
{/* 404 redirect to home page */} | ||
<Route path='*' element={<Navigate to='/' />} /> | ||
</Routes> | ||
</Suspense> | ||
); | ||
} | ||
|
||
export default Routing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters