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
432d17bd
Unverified
Commit
432d17bd
authored
Apr 29, 2021
by
Noah Zinsmeister
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only show buttons if nft is owned
parent
9743b211
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
35 deletions
+42
-35
PositionPage.tsx
src/pages/Pool/PositionPage.tsx
+42
-35
No files found.
src/pages/Pool/PositionPage.tsx
View file @
432d17bd
...
...
@@ -31,6 +31,7 @@ import ReactGA from 'react-ga'
import
{
TransactionResponse
}
from
'
@ethersproject/providers
'
import
{
Dots
}
from
'
components/swap/styleds
'
import
{
getPriceOrderingFromPositionForUI
}
from
'
../../components/PositionListItem
'
import
{
useSingleCallResult
}
from
'
state/multicall/hooks
'
const
PageWrapper
=
styled
.
div
`
min-width: 800px;
...
...
@@ -233,6 +234,9 @@ export function PositionPage({
})
},
[
chainId
,
feeValue0
,
feeValue1
,
positionManager
,
account
,
tokenId
,
addTransaction
,
library
])
const
owner
=
useSingleCallResult
(
!!
tokenId
?
positionManager
:
null
,
'
ownerOf
'
,
[
tokenId
]).
result
?.[
0
]
const
ownsNFT
=
owner
===
account
||
positionDetails
?.
operator
===
account
return
loading
||
poolState
===
PoolState
.
LOADING
||
!
feeAmount
?
(
<
LoadingRows
>
<
div
/>
...
...
@@ -262,6 +266,8 @@ export function PositionPage({
<
BadgeText
>
{
basisPointsToPercent
(
feeAmount
/
100
).
toSignificant
()
}
%
</
BadgeText
>
</
Badge
>
</
RowFixed
>
{
ownsNFT
&&
(
<
RowFixed
>
{
feeValue0
?.
greaterThan
(
0
)
||
feeValue1
?.
greaterThan
(
0
)
||
!!
collectMigrationHash
?
(
<
ButtonConfirmed
...
...
@@ -297,6 +303,7 @@ export function PositionPage({
</
Link
>
)
}
</
RowFixed
>
)
}
</
RowBetween
>
<
RowBetween
>
<
BadgeWrapper
>
...
...
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