Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
f6dea479
Unverified
Commit
f6dea479
authored
Jul 07, 2021
by
Noah Zinsmeister
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix l2 routing bug
parent
8e9981e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
chains.ts
src/constants/chains.ts
+6
-1
App.tsx
src/pages/App.tsx
+9
-9
No files found.
src/constants/chains.ts
View file @
f6dea479
...
@@ -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
]:
{
...
...
src/pages/App.tsx
View file @
f6dea479
...
@@ -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
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment