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
e97939c5
Unverified
Commit
e97939c5
authored
Apr 19, 2021
by
Ian Lapham
Committed by
GitHub
Apr 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update position details page (#43)
parent
63907b7b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
5 deletions
+69
-5
index.tsx
src/pages/AddLiquidity/index.tsx
+7
-0
PositionPage.tsx
src/pages/Pool/PositionPage.tsx
+62
-5
No files found.
src/pages/AddLiquidity/index.tsx
View file @
e97939c5
...
...
@@ -304,6 +304,13 @@ export default function AddLiquidity({
}
})
})
.
catch
((
error
)
=>
{
setAttemptingTxn
(
false
)
// we only care if the error is something _other_ than the user rejected the tx
if
(
error
?.
code
!==
4001
)
{
console
.
error
(
error
)
}
})
}
else
{
return
}
...
...
src/pages/Pool/PositionPage.tsx
View file @
e97939c5
...
...
@@ -15,7 +15,7 @@ import { TYPE } from 'theme'
import
Badge
,
{
BadgeVariant
}
from
'
components/Badge
'
import
{
basisPointsToPercent
}
from
'
utils
'
import
{
ButtonPrimary
}
from
'
components/Button
'
import
{
DarkCard
}
from
'
components/Card
'
import
{
DarkCard
,
DarkGreyCard
}
from
'
components/Card
'
import
CurrencyLogo
from
'
components/CurrencyLogo
'
import
{
AlertTriangle
}
from
'
react-feather
'
import
{
useTranslation
}
from
'
react-i18next
'
...
...
@@ -73,6 +73,13 @@ const ActiveDot = styled.span`
margin-right: 4px;
`
const
DarkBadge
=
styled
.
div
`
widthL fit-content;
border-radius: 8px;
background-color:
${({
theme
})
=>
theme
.
bg0
}
;
padding: 4px 6px;
`
export
function
PositionPage
({
match
:
{
params
:
{
positionIndex
},
...
...
@@ -111,10 +118,10 @@ export function PositionPage({
return
undefined
},
[
liquidity
,
pool
,
tickLower
,
tickUpper
])
//
const price0Lower = position ? position.token0PriceLower : undefined
//
const price0Upper = position ? position.token0PriceUpper : undefined
//
const price1Lower = price0Upper ? price0Upper.invert() : undefined
//
const price1Upper = price0Lower ? price0Lower.invert() : undefined
const
price0Lower
=
position
?
position
.
token0PriceLower
:
undefined
const
price0Upper
=
position
?
position
.
token0PriceUpper
:
undefined
const
price1Lower
=
price0Upper
?
price0Upper
.
invert
()
:
undefined
const
price1Upper
=
price0Lower
?
price0Lower
.
invert
()
:
undefined
// check if price is within range
const
outOfRange
:
boolean
=
...
...
@@ -204,6 +211,56 @@ export function PositionPage({
<
DarkCard
>
<
AutoColumn
gap=
"lg"
>
<
TYPE
.
label
>
Position Limits
</
TYPE
.
label
>
<
RowBetween
>
<
DarkGreyCard
width=
"49%"
>
<
AutoColumn
gap=
"sm"
justify=
"flex-start"
>
<
TYPE
.
main
>
Lower Limit
</
TYPE
.
main
>
<
RowFixed
>
<
TYPE
.
label
>
{
price0Lower
?.
toSignificant
(
4
)
}
</
TYPE
.
label
>
<
TYPE
.
label
ml=
"10px"
>
{
currency0
?.
symbol
}
/
{
currency1
?.
symbol
}
</
TYPE
.
label
>
</
RowFixed
>
<
RowFixed
>
<
TYPE
.
label
>
{
price1Lower
?.
toSignificant
(
4
)
}
</
TYPE
.
label
>
<
TYPE
.
label
ml=
"10px"
>
{
currency1
?.
symbol
}
/
{
currency0
?.
symbol
}
</
TYPE
.
label
>
</
RowFixed
>
<
DarkBadge
>
<
RowFixed
>
<
TYPE
.
label
mr=
"6px"
>
100%
</
TYPE
.
label
>
<
CurrencyLogo
currency=
{
currency0
}
size=
"16px"
/>
<
TYPE
.
label
ml=
"4px"
>
{
currency0
?.
symbol
}
</
TYPE
.
label
>
</
RowFixed
>
</
DarkBadge
>
</
AutoColumn
>
</
DarkGreyCard
>
<
DarkGreyCard
width=
"49%"
>
<
AutoColumn
gap=
"sm"
justify=
"flex-start"
>
<
TYPE
.
main
>
Lower Limit
</
TYPE
.
main
>
<
RowFixed
>
<
TYPE
.
label
>
{
price0Upper
?.
toSignificant
(
4
)
}
</
TYPE
.
label
>
<
TYPE
.
label
ml=
"10px"
>
{
currency0
?.
symbol
}
/
{
currency1
?.
symbol
}
</
TYPE
.
label
>
</
RowFixed
>
<
RowFixed
>
<
TYPE
.
label
>
{
price1Upper
?.
toSignificant
(
4
)
}
</
TYPE
.
label
>
<
TYPE
.
label
ml=
"10px"
>
{
currency1
?.
symbol
}
/
{
currency0
?.
symbol
}
</
TYPE
.
label
>
</
RowFixed
>
<
DarkBadge
>
<
RowFixed
>
<
TYPE
.
label
mr=
"6px"
>
100%
</
TYPE
.
label
>
<
CurrencyLogo
currency=
{
currency1
}
size=
"16px"
/>
<
TYPE
.
label
ml=
"4px"
>
{
currency1
?.
symbol
}
</
TYPE
.
label
>
</
RowFixed
>
</
DarkBadge
>
</
AutoColumn
>
</
DarkGreyCard
>
</
RowBetween
>
</
AutoColumn
>
</
DarkCard
>
</
AutoColumn
>
...
...
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