Commit f6dea479 authored by Noah Zinsmeister's avatar Noah Zinsmeister

fix l2 routing bug

parent 8e9981e1
...@@ -13,7 +13,12 @@ export enum SupportedChainId { ...@@ -13,7 +13,12 @@ export enum SupportedChainId {
OPTIMISTIC_KOVAN = 69, 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 }> = { export const L2_INFO: Record<number, { bridge: string; docs: string; explorer: string; logoUrl: string }> = {
[SupportedChainId.OPTIMISM]: { [SupportedChainId.OPTIMISM]: {
......
...@@ -74,36 +74,36 @@ function TopLevelModals() { ...@@ -74,36 +74,36 @@ function TopLevelModals() {
const Routes = () => { const Routes = () => {
const { chainId } = useActiveWeb3React() 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 ( return (
<Switch> <Switch>
<Route exact strict path="/vote" component={Vote} /> <Route exact strict path="/vote" component={Vote} />
<Route exact strict path="/vote/:governorIndex/:id" component={VotePage} /> <Route exact strict path="/vote/:governorIndex/:id" component={VotePage} />
<Route exact strict path="/claim" component={OpenClaimAddressModalAndRedirectToSwap} /> <Route exact strict path="/claim" component={OpenClaimAddressModalAndRedirectToSwap} />
{HIDE_ON_L2 && <Route exact strict path="/uni" component={Earn} />} {!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/:currencyIdA/:currencyIdB" component={Manage} />}
<Route exact strict path="/send" component={RedirectPathToSwapOnly} /> <Route exact strict path="/send" component={RedirectPathToSwapOnly} />
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} /> <Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
<Route exact strict path="/swap" component={Swap} /> <Route exact strict path="/swap" component={Swap} />
{HIDE_ON_L2 && <Route exact strict path="/pool/v2/find" component={PoolFinder} />} {!ON_L2 && <Route strict path="/pool/v2" component={PoolV2} />}
{HIDE_ON_L2 && <Route exact 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" component={Pool} />
<Route exact strict path="/pool/:tokenId" component={PositionPage} /> <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/v2/:currencyIdA?/:currencyIdB?" component={RedirectDuplicateTokenIdsV2} />
)} )}
<Route exact strict path="/add/:currencyIdA?/:currencyIdB?/:feeAmount?" component={RedirectDuplicateTokenIds} /> <Route exact strict path="/add/:currencyIdA?/:currencyIdB?/:feeAmount?" component={RedirectDuplicateTokenIds} />
<Route exact strict path="/increase/:currencyIdA?/:currencyIdB?/:feeAmount?/:tokenId?" component={AddLiquidity} /> <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} /> <Route exact strict path="/remove/:tokenId" component={RemoveLiquidityV3} />
{HIDE_ON_L2 && <Route exact strict path="/migrate/v2" component={MigrateV2} />} {!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/:address" component={MigrateV2Pair} />}
<Route exact strict path="/create-proposal" component={CreateProposal} /> <Route exact strict path="/create-proposal" component={CreateProposal} />
<Route component={RedirectPathToSwapOnly} /> <Route component={RedirectPathToSwapOnly} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment