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
568b05fd
Unverified
Commit
568b05fd
authored
Mar 16, 2023
by
Vignesh Mohankumar
Committed by
GitHub
Mar 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support both /pool and /pools (#6173)
* more * change locally
parent
3d0ca210
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
27 additions
and
21 deletions
+27
-21
README.md
README.md
+1
-1
landing.test.ts
cypress/e2e/landing.test.ts
+1
-1
pool.test.ts
cypress/e2e/pool.test.ts
+1
-1
wallet-dropdown.test.ts
cypress/e2e/wallet-dropdown.test.ts
+1
-1
AboutFooter.tsx
src/components/About/AboutFooter.tsx
+1
-1
constants.tsx
src/components/About/constants.tsx
+1
-1
index.tsx
src/components/NavBar/index.tsx
+2
-2
index.tsx
src/components/NavigationTabs/index.tsx
+2
-2
index.tsx
src/components/PositionListItem/index.tsx
+1
-1
useIsPoolPage.ts
src/hooks/useIsPoolPage.ts
+1
-1
index.tsx
src/pages/AddLiquidity/index.tsx
+1
-1
App.tsx
src/pages/App.tsx
+6
-0
index.tsx
src/pages/MigrateV2/index.tsx
+2
-2
PositionPage.tsx
src/pages/Pool/PositionPage.tsx
+1
-1
index.tsx
src/pages/Pool/index.tsx
+1
-1
v2.tsx
src/pages/Pool/v2.tsx
+1
-1
index.tsx
src/pages/PoolFinder/index.tsx
+2
-2
V3.tsx
src/pages/RemoveLiquidity/V3.tsx
+1
-1
No files found.
README.md
View file @
568b05fd
...
@@ -43,7 +43,7 @@ For steps on local deployment, development, and code contribution, please see [C
...
@@ -43,7 +43,7 @@ For steps on local deployment, development, and code contribution, please see [C
The Uniswap Interface supports swapping, adding liquidity, removing liquidity and migrating liquidity for Uniswap protocol V2.
The Uniswap Interface supports swapping, adding liquidity, removing liquidity and migrating liquidity for Uniswap protocol V2.
-
Swap on Uniswap V2:
<https://app.uniswap.org/#/swap?use=v2>
-
Swap on Uniswap V2:
<https://app.uniswap.org/#/swap?use=v2>
-
View V2 liquidity:
<https://app.uniswap.org/#/pool/v2>
-
View V2 liquidity:
<https://app.uniswap.org/#/pool
s
/v2>
-
Add V2 liquidity:
<https://app.uniswap.org/#/add/v2>
-
Add V2 liquidity:
<https://app.uniswap.org/#/add/v2>
-
Migrate V2 liquidity to V3:
<https://app.uniswap.org/#/migrate/v2>
-
Migrate V2 liquidity to V3:
<https://app.uniswap.org/#/migrate/v2>
...
...
cypress/e2e/landing.test.ts
View file @
568b05fd
...
@@ -26,6 +26,6 @@ describe('Landing Page', () => {
...
@@ -26,6 +26,6 @@ describe('Landing Page', () => {
it
(
'
allows navigation to pool
'
,
()
=>
{
it
(
'
allows navigation to pool
'
,
()
=>
{
cy
.
get
(
getTestSelector
(
'
pool-nav-link
'
)).
first
().
click
()
cy
.
get
(
getTestSelector
(
'
pool-nav-link
'
)).
first
().
click
()
cy
.
url
().
should
(
'
include
'
,
'
/pool
'
)
cy
.
url
().
should
(
'
include
'
,
'
/pool
s
'
)
})
})
})
})
cypress/e2e/pool.test.ts
View file @
568b05fd
describe
(
'
Pool
'
,
()
=>
{
describe
(
'
Pool
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
cy
.
visit
(
'
/pool
'
).
then
(()
=>
{
cy
.
visit
(
'
/pool
s
'
).
then
(()
=>
{
cy
.
wait
(
'
@eth_blockNumber
'
)
cy
.
wait
(
'
@eth_blockNumber
'
)
})
})
})
})
...
...
cypress/e2e/wallet-dropdown.test.ts
View file @
568b05fd
...
@@ -2,7 +2,7 @@ import { getTestSelector } from '../utils'
...
@@ -2,7 +2,7 @@ import { getTestSelector } from '../utils'
describe
(
'
Wallet Dropdown
'
,
()
=>
{
describe
(
'
Wallet Dropdown
'
,
()
=>
{
before
(()
=>
{
before
(()
=>
{
cy
.
visit
(
'
/pool
'
)
cy
.
visit
(
'
/pool
s
'
)
})
})
it
(
'
should change the theme
'
,
()
=>
{
it
(
'
should change the theme
'
,
()
=>
{
...
...
src/components/About/AboutFooter.tsx
View file @
568b05fd
...
@@ -149,7 +149,7 @@ export const AboutFooter = () => {
...
@@ -149,7 +149,7 @@ export const AboutFooter = () => {
<
TextLink
to=
"/swap"
>
Swap
</
TextLink
>
<
TextLink
to=
"/swap"
>
Swap
</
TextLink
>
<
TextLink
to=
"/tokens"
>
Tokens
</
TextLink
>
<
TextLink
to=
"/tokens"
>
Tokens
</
TextLink
>
<
TextLink
to=
"/nfts"
>
NFTs
</
TextLink
>
<
TextLink
to=
"/nfts"
>
NFTs
</
TextLink
>
<
TextLink
to=
"/pool"
>
Pools
</
TextLink
>
<
TextLink
to=
"/pool
s
"
>
Pools
</
TextLink
>
</
LinkGroup
>
</
LinkGroup
>
<
LinkGroup
>
<
LinkGroup
>
<
LinkGroupTitle
>
Protocol
</
LinkGroupTitle
>
<
LinkGroupTitle
>
Protocol
</
LinkGroupTitle
>
...
...
src/components/About/constants.tsx
View file @
568b05fd
...
@@ -50,7 +50,7 @@ export const MORE_CARDS = [
...
@@ -50,7 +50,7 @@ export const MORE_CARDS = [
elementName
:
InterfaceElementName
.
ABOUT_PAGE_BUY_CRYPTO_CARD
,
elementName
:
InterfaceElementName
.
ABOUT_PAGE_BUY_CRYPTO_CARD
,
},
},
{
{
to
:
'
/pool
'
,
to
:
'
/pool
s
'
,
title
:
'
Earn
'
,
title
:
'
Earn
'
,
description
:
'
Provide liquidity to pools on Uniswap and earn fees on swaps.
'
,
description
:
'
Provide liquidity to pools on Uniswap and earn fees on swaps.
'
,
lightIcon
:
<
StyledCardLogo
src=
{
lightArrowImgSrc
}
alt=
"Analytics"
/>,
lightIcon
:
<
StyledCardLogo
src=
{
lightArrowImgSrc
}
alt=
"Analytics"
/>,
...
...
src/components/NavBar/index.tsx
View file @
568b05fd
...
@@ -67,8 +67,8 @@ export const PageTabs = () => {
...
@@ -67,8 +67,8 @@ export const PageTabs = () => {
<
MenuItem
dataTestId=
"nft-nav"
href=
"/nfts"
isActive=
{
isNftPage
}
>
<
MenuItem
dataTestId=
"nft-nav"
href=
"/nfts"
isActive=
{
isNftPage
}
>
<
Trans
>
NFTs
</
Trans
>
<
Trans
>
NFTs
</
Trans
>
</
MenuItem
>
</
MenuItem
>
<
MenuItem
href=
"/pool"
dataTestId=
"pool-nav-link"
isActive=
{
isPoolActive
}
>
<
MenuItem
href=
"/pool
s
"
dataTestId=
"pool-nav-link"
isActive=
{
isPoolActive
}
>
<
Trans
>
Pool
</
Trans
>
<
Trans
>
Pool
s
</
Trans
>
</
MenuItem
>
</
MenuItem
>
</>
</>
)
)
...
...
src/components/NavigationTabs/index.tsx
View file @
568b05fd
...
@@ -75,8 +75,8 @@ export function AddRemoveTabs({
...
@@ -75,8 +75,8 @@ export function AddRemoveTabs({
// detect if back should redirect to v3 or v2 pool page
// detect if back should redirect to v3 or v2 pool page
const
poolLink
=
location
.
pathname
.
includes
(
'
add/v2
'
)
const
poolLink
=
location
.
pathname
.
includes
(
'
add/v2
'
)
?
'
/pool/v2
'
?
'
/pool
s
/v2
'
:
'
/pool
'
+
(
positionID
?
`/
${
positionID
.
toString
()}
`
:
''
)
:
'
/pool
s
'
+
(
positionID
?
`/
${
positionID
.
toString
()}
`
:
''
)
return
(
return
(
<
Tabs
>
<
Tabs
>
...
...
src/components/PositionListItem/index.tsx
View file @
568b05fd
...
@@ -210,7 +210,7 @@ export default function PositionListItem({
...
@@ -210,7 +210,7 @@ export default function PositionListItem({
// check if price is within range
// check if price is within range
const
outOfRange
:
boolean
=
pool
?
pool
.
tickCurrent
<
tickLower
||
pool
.
tickCurrent
>=
tickUpper
:
false
const
outOfRange
:
boolean
=
pool
?
pool
.
tickCurrent
<
tickLower
||
pool
.
tickCurrent
>=
tickUpper
:
false
const
positionSummaryLink
=
'
/pool/
'
+
tokenId
const
positionSummaryLink
=
'
/pool
s
/
'
+
tokenId
const
removed
=
liquidity
?.
eq
(
0
)
const
removed
=
liquidity
?.
eq
(
0
)
...
...
src/hooks/useIsPoolPage.ts
View file @
568b05fd
...
@@ -3,7 +3,7 @@ import { useLocation } from 'react-router-dom'
...
@@ -3,7 +3,7 @@ import { useLocation } from 'react-router-dom'
export
function
useIsPoolPage
()
{
export
function
useIsPoolPage
()
{
const
{
pathname
}
=
useLocation
()
const
{
pathname
}
=
useLocation
()
return
(
return
(
pathname
.
startsWith
(
'
/pool
'
)
||
pathname
.
startsWith
(
'
/pool
s
'
)
||
pathname
.
startsWith
(
'
/add
'
)
||
pathname
.
startsWith
(
'
/add
'
)
||
pathname
.
startsWith
(
'
/remove
'
)
||
pathname
.
startsWith
(
'
/remove
'
)
||
pathname
.
startsWith
(
'
/increase
'
)
pathname
.
startsWith
(
'
/increase
'
)
...
...
src/pages/AddLiquidity/index.tsx
View file @
568b05fd
...
@@ -372,7 +372,7 @@ export default function AddLiquidity() {
...
@@ -372,7 +372,7 @@ export default function AddLiquidity() {
if
(
txHash
)
{
if
(
txHash
)
{
onFieldAInput
(
''
)
onFieldAInput
(
''
)
// dont jump to pool page if creating
// dont jump to pool page if creating
navigate
(
'
/pool
'
)
navigate
(
'
/pool
s
'
)
}
}
setTxHash
(
''
)
setTxHash
(
''
)
},
[
navigate
,
onFieldAInput
,
txHash
])
},
[
navigate
,
onFieldAInput
,
txHash
])
...
...
src/pages/App.tsx
View file @
568b05fd
...
@@ -97,6 +97,7 @@ function getCurrentPageFromLocation(locationPathname: string): InterfacePageName
...
@@ -97,6 +97,7 @@ function getCurrentPageFromLocation(locationPathname: string): InterfacePageName
return
InterfacePageName
.
SWAP_PAGE
return
InterfacePageName
.
SWAP_PAGE
case
locationPathname
.
startsWith
(
'
/vote
'
):
case
locationPathname
.
startsWith
(
'
/vote
'
):
return
InterfacePageName
.
VOTE_PAGE
return
InterfacePageName
.
VOTE_PAGE
case
locationPathname
.
startsWith
(
'
/pools
'
):
case
locationPathname
.
startsWith
(
'
/pool
'
):
case
locationPathname
.
startsWith
(
'
/pool
'
):
return
InterfacePageName
.
POOL_PAGE
return
InterfacePageName
.
POOL_PAGE
case
locationPathname
.
startsWith
(
'
/tokens
'
):
case
locationPathname
.
startsWith
(
'
/tokens
'
):
...
@@ -237,6 +238,11 @@ export default function App() {
...
@@ -237,6 +238,11 @@ export default function App() {
<
Route
path=
"pool"
element=
{
<
Pool
/>
}
/>
<
Route
path=
"pool"
element=
{
<
Pool
/>
}
/>
<
Route
path=
"pool/:tokenId"
element=
{
<
PositionPage
/>
}
/>
<
Route
path=
"pool/:tokenId"
element=
{
<
PositionPage
/>
}
/>
<
Route
path=
"pools/v2/find"
element=
{
<
PoolFinder
/>
}
/>
<
Route
path=
"pools/v2"
element=
{
<
PoolV2
/>
}
/>
<
Route
path=
"pools"
element=
{
<
Pool
/>
}
/>
<
Route
path=
"pools/:tokenId"
element=
{
<
PositionPage
/>
}
/>
<
Route
path=
"add/v2"
element=
{
<
RedirectDuplicateTokenIdsV2
/>
}
>
<
Route
path=
"add/v2"
element=
{
<
RedirectDuplicateTokenIdsV2
/>
}
>
<
Route
path=
":currencyIdA"
/>
<
Route
path=
":currencyIdA"
/>
<
Route
path=
":currencyIdA/:currencyIdB"
/>
<
Route
path=
":currencyIdA/:currencyIdB"
/>
...
...
src/pages/MigrateV2/index.tsx
View file @
568b05fd
...
@@ -116,7 +116,7 @@ export default function MigrateV2() {
...
@@ -116,7 +116,7 @@ export default function MigrateV2() {
<
BodyWrapper
style=
{
{
padding
:
24
}
}
>
<
BodyWrapper
style=
{
{
padding
:
24
}
}
>
<
AutoColumn
gap=
"16px"
>
<
AutoColumn
gap=
"16px"
>
<
AutoRow
style=
{
{
alignItems
:
'
center
'
,
justifyContent
:
'
space-between
'
}
}
gap=
"8px"
>
<
AutoRow
style=
{
{
alignItems
:
'
center
'
,
justifyContent
:
'
space-between
'
}
}
gap=
"8px"
>
<
BackArrow
to=
"/pool"
/>
<
BackArrow
to=
"/pool
s
"
/>
<
ThemedText
.
DeprecatedMediumHeader
>
<
ThemedText
.
DeprecatedMediumHeader
>
<
Trans
>
Migrate V2 Liquidity
</
Trans
>
<
Trans
>
Migrate V2 Liquidity
</
Trans
>
</
ThemedText
.
DeprecatedMediumHeader
>
</
ThemedText
.
DeprecatedMediumHeader
>
...
@@ -173,7 +173,7 @@ export default function MigrateV2() {
...
@@ -173,7 +173,7 @@ export default function MigrateV2() {
<
Text
textAlign=
"center"
fontSize=
{
14
}
style=
{
{
padding
:
'
.5rem 0 .5rem 0
'
}
}
>
<
Text
textAlign=
"center"
fontSize=
{
14
}
style=
{
{
padding
:
'
.5rem 0 .5rem 0
'
}
}
>
<
Trans
>
<
Trans
>
Don’t see one of your v2 positions?
{
'
'
}
Don’t see one of your v2 positions?
{
'
'
}
<
StyledInternalLink
id=
"import-pool-link"
to=
"/pool/v2/find"
>
<
StyledInternalLink
id=
"import-pool-link"
to=
"/pool
s
/v2/find"
>
Import it.
Import it.
</
StyledInternalLink
>
</
StyledInternalLink
>
</
Trans
>
</
Trans
>
...
...
src/pages/Pool/PositionPage.tsx
View file @
568b05fd
...
@@ -616,7 +616,7 @@ export function PositionPage() {
...
@@ -616,7 +616,7 @@ export function PositionPage() {
<
Link
<
Link
data
-
cy=
"visit-pool"
data
-
cy=
"visit-pool"
style=
{
{
textDecoration
:
'
none
'
,
width
:
'
fit-content
'
,
marginBottom
:
'
0.5rem
'
}
}
style=
{
{
textDecoration
:
'
none
'
,
width
:
'
fit-content
'
,
marginBottom
:
'
0.5rem
'
}
}
to=
"/pool"
to=
"/pool
s
"
>
>
<
HoverText
>
<
HoverText
>
<
Trans
>
← Back to Pools
</
Trans
>
<
Trans
>
← Back to Pools
</
Trans
>
...
...
src/pages/Pool/index.tsx
View file @
568b05fd
...
@@ -241,7 +241,7 @@ export default function Pool() {
...
@@ -241,7 +241,7 @@ export default function Pool() {
<
Layers
size=
{
16
}
/>
<
Layers
size=
{
16
}
/>
</
PoolMenuItem
>
</
PoolMenuItem
>
),
),
link
:
'
/pool/v2
'
,
link
:
'
/pool
s
/v2
'
,
external
:
false
,
external
:
false
,
},
},
{
{
...
...
src/pages/Pool/v2.tsx
View file @
568b05fd
...
@@ -199,7 +199,7 @@ export default function Pool() {
...
@@ -199,7 +199,7 @@ export default function Pool() {
<
ResponsiveButtonSecondary
as=
{
Link
}
padding=
"6px 8px"
to=
"/add/v2/ETH"
>
<
ResponsiveButtonSecondary
as=
{
Link
}
padding=
"6px 8px"
to=
"/add/v2/ETH"
>
<
Trans
>
Create a pair
</
Trans
>
<
Trans
>
Create a pair
</
Trans
>
</
ResponsiveButtonSecondary
>
</
ResponsiveButtonSecondary
>
<
ResponsiveButtonPrimary
id=
"find-pool-button"
as=
{
Link
}
to=
"/pool/v2/find"
padding=
"6px 8px"
>
<
ResponsiveButtonPrimary
id=
"find-pool-button"
as=
{
Link
}
to=
"/pool
s
/v2/find"
padding=
"6px 8px"
>
<
Text
fontWeight=
{
500
}
fontSize=
{
16
}
>
<
Text
fontWeight=
{
500
}
fontSize=
{
16
}
>
<
Trans
>
Import Pool
</
Trans
>
<
Trans
>
Import Pool
</
Trans
>
</
Text
>
</
Text
>
...
...
src/pages/PoolFinder/index.tsx
View file @
568b05fd
...
@@ -100,7 +100,7 @@ export default function PoolFinder() {
...
@@ -100,7 +100,7 @@ export default function PoolFinder() {
<
Trace
page=
{
InterfacePageName
.
POOL_PAGE
}
shouldLogImpression
>
<
Trace
page=
{
InterfacePageName
.
POOL_PAGE
}
shouldLogImpression
>
<>
<>
<
AppBody
>
<
AppBody
>
<
FindPoolTabs
origin=
{
query
.
get
(
'
origin
'
)
??
'
/pool/v2
'
}
/>
<
FindPoolTabs
origin=
{
query
.
get
(
'
origin
'
)
??
'
/pool
s
/v2
'
}
/>
<
AutoColumn
style=
{
{
padding
:
'
1rem
'
}
}
gap=
"md"
>
<
AutoColumn
style=
{
{
padding
:
'
1rem
'
}
}
gap=
"md"
>
<
BlueCard
>
<
BlueCard
>
<
AutoColumn
gap=
"10px"
>
<
AutoColumn
gap=
"10px"
>
...
@@ -162,7 +162,7 @@ export default function PoolFinder() {
...
@@ -162,7 +162,7 @@ export default function PoolFinder() {
<
Text
textAlign=
"center"
fontWeight=
{
500
}
>
<
Text
textAlign=
"center"
fontWeight=
{
500
}
>
<
Trans
>
Pool Found!
</
Trans
>
<
Trans
>
Pool Found!
</
Trans
>
</
Text
>
</
Text
>
<
StyledInternalLink
to=
"
/pool
/v2"
>
<
StyledInternalLink
to=
"
pools
/v2"
>
<
Text
textAlign=
"center"
>
<
Text
textAlign=
"center"
>
<
Trans
>
Manage this pool.
</
Trans
>
<
Trans
>
Manage this pool.
</
Trans
>
</
Text
>
</
Text
>
...
...
src/pages/RemoveLiquidity/V3.tsx
View file @
568b05fd
...
@@ -55,7 +55,7 @@ export default function RemoveLiquidityV3() {
...
@@ -55,7 +55,7 @@ export default function RemoveLiquidityV3() {
},
[
tokenId
])
},
[
tokenId
])
if
(
parsedTokenId
===
null
||
parsedTokenId
.
eq
(
0
))
{
if
(
parsedTokenId
===
null
||
parsedTokenId
.
eq
(
0
))
{
return
<
Navigate
to=
{
{
...
location
,
pathname
:
'
/pool
'
}
}
replace
/>
return
<
Navigate
to=
{
{
...
location
,
pathname
:
'
/pool
s
'
}
}
replace
/>
}
}
return
<
Remove
tokenId=
{
parsedTokenId
}
/>
return
<
Remove
tokenId=
{
parsedTokenId
}
/>
...
...
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