-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
776 additions
and
458 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { useRoutes } from 'react-router-dom'; | ||
import { NotFound } from './components/NotFound'; | ||
import { ActiveSwapsPage } from './pages/ActiveSwapsPage'; | ||
import { MainPage } from './pages/MainPage'; | ||
import { SelectChainPage } from './pages/SelectChainPage'; | ||
import { SelectTokenPage } from './pages/SelectTokenPage'; | ||
import { SelectWalletPage } from './pages/SelectWalletPage'; | ||
import { SettingsPage } from './pages/SettingsPage'; | ||
import { SwapDetailsPage } from './pages/SwapDetailsPage'; | ||
import { SwapHistoryPage } from './pages/SwapHistoryPage'; | ||
import { SwapPage } from './pages/SwapPage'; | ||
import { SwapRoutesPage } from './pages/SwapRoutesPage'; | ||
import { navigationRoutes } from './utils'; | ||
|
||
export const AppRoutes = () => { | ||
const element = useRoutes([ | ||
{ | ||
path: '/', | ||
element: <MainPage />, | ||
}, | ||
{ | ||
path: navigationRoutes.settings, | ||
element: <SettingsPage />, | ||
}, | ||
{ | ||
path: navigationRoutes.fromToken, | ||
element: <SelectTokenPage formType="from" />, | ||
}, | ||
{ | ||
path: navigationRoutes.toToken, | ||
element: <SelectTokenPage formType="to" />, | ||
}, | ||
...[ | ||
navigationRoutes.fromChain, | ||
`${navigationRoutes.fromToken}/${navigationRoutes.fromChain}`, | ||
].map((path) => ({ | ||
path, | ||
element: <SelectChainPage formType="from" />, | ||
})), | ||
...[ | ||
navigationRoutes.toChain, | ||
`${navigationRoutes.toToken}/${navigationRoutes.toChain}`, | ||
].map((path) => ({ | ||
path, | ||
element: <SelectChainPage formType="to" />, | ||
})), | ||
{ | ||
path: navigationRoutes.swapRoutes, | ||
element: <SwapRoutesPage />, | ||
}, | ||
{ | ||
path: navigationRoutes.activeSwaps, | ||
element: <ActiveSwapsPage />, | ||
}, | ||
{ | ||
path: navigationRoutes.swapHistory, | ||
element: <SwapHistoryPage />, | ||
}, | ||
{ | ||
path: `${navigationRoutes.swapHistory}/${navigationRoutes.swapDetails}`, | ||
element: <SwapDetailsPage />, | ||
}, | ||
...[ | ||
navigationRoutes.selectWallet, | ||
`${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`, | ||
`${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`, | ||
].map((path) => ({ | ||
path, | ||
element: <SelectWalletPage />, | ||
})), | ||
...[ | ||
navigationRoutes.swapExecution, | ||
`${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}`, | ||
`${navigationRoutes.activeSwaps}/${navigationRoutes.swapExecution}`, | ||
].map((path) => ({ | ||
path, | ||
element: <SwapPage />, | ||
})), | ||
{ | ||
path: '*', | ||
element: <NotFound />, | ||
}, | ||
]); | ||
return element; | ||
}; |
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
Oops, something went wrong.