fix l2 routing bug

This commit is contained in:
Noah Zinsmeister 2021-07-07 09:38:29 -04:00
parent 8e9981e186
commit f6dea47907
No known key found for this signature in database
GPG Key ID: 83022DD49188C9F2
2 changed files with 15 additions and 10 deletions

@ -13,7 +13,12 @@ export enum SupportedChainId {
OPTIMISTIC_KOVAN = 69,
}
export const L2_CHAIN_IDS = [SupportedChainId.ARBITRUM_ONE, SupportedChainId.OPTIMISM]
export const L2_CHAIN_IDS = [
SupportedChainId.ARBITRUM_ONE,
SupportedChainId.ARBITRUM_RINKEBY,
SupportedChainId.OPTIMISM,
SupportedChainId.OPTIMISTIC_KOVAN,
]
export const L2_INFO: Record<number, { bridge: string; docs: string; explorer: string; logoUrl: string }> = {
[SupportedChainId.OPTIMISM]: {

@ -74,36 +74,36 @@ function TopLevelModals() {
const Routes = () => {
const { chainId } = useActiveWeb3React()
const HIDE_ON_L2 = Boolean(chainId && L2_CHAIN_IDS.includes(chainId))
const ON_L2 = Boolean(chainId && L2_CHAIN_IDS.includes(chainId))
return (
<Switch>
<Route exact strict path="/vote" component={Vote} />
<Route exact strict path="/vote/:governorIndex/:id" component={VotePage} />
<Route exact strict path="/claim" component={OpenClaimAddressModalAndRedirectToSwap} />
{HIDE_ON_L2 && <Route exact strict path="/uni" component={Earn} />}
{HIDE_ON_L2 && <Route exact strict path="/uni/:currencyIdA/:currencyIdB" component={Manage} />}
{!ON_L2 && <Route exact strict path="/uni" component={Earn} />}
{!ON_L2 && <Route exact strict path="/uni/:currencyIdA/:currencyIdB" component={Manage} />}
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
<Route exact strict path="/swap" component={Swap} />
{HIDE_ON_L2 && <Route exact strict path="/pool/v2/find" component={PoolFinder} />}
{HIDE_ON_L2 && <Route exact strict path="/pool/v2" component={PoolV2} />}
{!ON_L2 && <Route strict path="/pool/v2" component={PoolV2} />}
{!ON_L2 && <Route exact strict path="/pool/v2/find" component={PoolFinder} />}
<Route exact strict path="/pool" component={Pool} />
<Route exact strict path="/pool/:tokenId" component={PositionPage} />
{HIDE_ON_L2 && (
{!ON_L2 && (
<Route exact strict path="/add/v2/:currencyIdA?/:currencyIdB?" component={RedirectDuplicateTokenIdsV2} />
)}
<Route exact strict path="/add/:currencyIdA?/:currencyIdB?/:feeAmount?" component={RedirectDuplicateTokenIds} />
<Route exact strict path="/increase/:currencyIdA?/:currencyIdB?/:feeAmount?/:tokenId?" component={AddLiquidity} />
{HIDE_ON_L2 && <Route exact strict path="/remove/v2/:currencyIdA/:currencyIdB" component={RemoveLiquidity} />}
{!ON_L2 && <Route exact strict path="/remove/v2/:currencyIdA/:currencyIdB" component={RemoveLiquidity} />}
<Route exact strict path="/remove/:tokenId" component={RemoveLiquidityV3} />
{HIDE_ON_L2 && <Route exact strict path="/migrate/v2" component={MigrateV2} />}
{HIDE_ON_L2 && <Route exact strict path="/migrate/v2/:address" component={MigrateV2Pair} />}
{!ON_L2 && <Route exact strict path="/migrate/v2" component={MigrateV2} />}
{!ON_L2 && <Route exact strict path="/migrate/v2/:address" component={MigrateV2Pair} />}
<Route exact strict path="/create-proposal" component={CreateProposal} />
<Route component={RedirectPathToSwapOnly} />