import React from 'react'; import { Outlet } from 'react-router-dom'; import Home from './home'; import NotFound from './not-found'; import NotPermitted from './not-permitted'; import Routes from './routes'; const LazyTranches = React.lazy( () => import( /* webpackChunkName: "route-tranches", webpackPrefetch: true */ './tranches' ) ); const LazyTranchesTranche = React.lazy( () => import( /* webpackChunkName: "route-tranches-tranche", webpackPrefetch: true */ './tranches/tranche' ) ); const LazyTranchesTranches = React.lazy( () => import( /* webpackChunkName: "route-tranches-tranches", webpackPrefetch: true */ './tranches/tranches' ) ); const LazyClaim = React.lazy( () => import( /* webpackChunkName: "route-claim", webpackPrefetch: true */ './claim' ) ); const LazyRedemption = React.lazy( () => import( /* webpackChunkName: "route-redemption", webpackPrefetch: true */ './redemption' ) ); const LazyRedemptionIndex = React.lazy( () => import( /* webpackChunkName: "route-redemption-index", webpackPrefetch: true */ './redemption/home/redemption-information' ) ); const LazyRedemptionTranche = React.lazy( () => import( /* webpackChunkName: "route-redemption-tranche", webpackPrefetch: true */ './redemption/tranche' ) ); const LazyStaking = React.lazy( () => import( /* webpackChunkName: "route-staking", webpackPrefetch: true */ './staking' ) ); const LazyStakingAssociate = React.lazy( () => import( /* webpackChunkName: "route-staking-associate", webpackPrefetch: true */ './staking/associate/associate-page-container' ) ); const LazyStakingDisassociate = React.lazy( () => import( /* webpackChunkName: "route-staking-disassociate", webpackPrefetch: true */ './staking/disassociate' ) ); const LazyStakingIndex = React.lazy( () => import( /* webpackChunkName: "route-staking-index", webpackPrefetch: true */ './staking/home' ) ); const LazyStakingNode = React.lazy( () => import( /* webpackChunkName: "route-staking-node", webpackPrefetch: true */ './staking/node' ) ); const LazyGovernance = React.lazy( () => import( /* webpackChunkName: "route-governance", webpackPrefetch: true */ './governance' ) ); const LazyGovernanceProposal = React.lazy( () => import( /* webpackChunkName: "route-governance-proposal", webpackPrefetch: true */ './governance/proposal' ) ); const LazyGovernanceProposals = React.lazy( () => import( /* webpackChunkName: "route-governance-proposals", webpackPrefetch: true */ './governance/proposals' ) ); const LazyRejectedGovernanceProposals = React.lazy( () => import( /* webpackChunkName: "route-governance-proposals", webpackPrefetch: true */ './governance/rejected' ) ); const LazyGovernancePropose = React.lazy( () => import( /* webpackChunkName: "route-governance-propose", webpackPrefetch: true */ './governance/propose' ) ); const LazyGovernanceProposeNetworkParameter = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-network-parameter", webpackPrefetch: true */ './governance/propose/network-parameter' ) ); const LazyGovernanceProposeNewMarket = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-new-market", webpackPrefetch: true */ './governance/propose/new-market' ) ); const LazyGovernanceProposeUpdateMarket = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-update-market", webpackPrefetch: true */ './governance/propose/update-market' ) ); const LazyGovernanceProposeNewAsset = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-new-asset", webpackPrefetch: true */ './governance/propose/new-asset' ) ); const LazyGovernanceProposeUpdateAsset = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-update-asset", webpackPrefetch: true */ './governance/propose/update-asset' ) ); const LazyGovernanceProposeFreeform = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-freeform", webpackPrefetch: true */ './governance/propose/freeform' ) ); const LazyGovernanceProposeRaw = React.lazy( () => import( /* webpackChunkName: "route-governance-propose-raw", webpackPrefetch: true */ './governance/propose/raw' ) ); const LazyRewards = React.lazy( () => import( /* webpackChunkName: "route-rewards", webpackPrefetch: true */ './rewards' ) ); const LazyContracts = React.lazy( () => import( /* webpackChunkName: "route-tranches", webpackPrefetch: true */ './contracts' ) ); const LazyWithdrawals = React.lazy( () => import( /* webpackChunkName: "route-withdrawals", webpackPrefetch: true */ './withdrawals' ) ); const routerConfig = [ { path: Routes.HOME, // Not lazy as loaded when a user first hits the site element: , }, { path: Routes.TRANCHES, element: , children: [ { index: true, element: }, { path: ':trancheId', element: }, ], }, { path: Routes.CLAIM, element: , }, { path: Routes.STAKING, element: , children: [ { path: 'associate', element: }, { path: 'disassociate', element: }, { path: ':node', element: }, { index: true, element: , }, ], }, { path: Routes.REWARDS, element: , }, { path: Routes.WITHDRAWALS, element: , }, { path: Routes.VESTING, element: , children: [ { index: true, element: , }, { path: ':id', element: , }, ], }, { path: Routes.GOVERNANCE, element: , children: [ { index: true, element: }, { path: 'propose', element: , children: [ { index: true, element: }, { path: 'network-parameter', element: , }, { path: 'new-market', element: , }, { path: 'update-market', element: , }, { path: 'new-asset', element: }, { path: 'update-asset', element: , }, { path: 'freeform', element: }, { path: 'raw', element: }, ], }, { path: ':proposalId', element: }, { path: 'rejected', element: }, ], }, { path: Routes.NOT_PERMITTED, // Not lazy as loaded when a user first hits the site element: , }, { path: Routes.CONTRACTS, element: , }, { path: '*', // Not lazy as loaded when a user first hits the site element: , }, ]; export default routerConfig;