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
332843f4
Unverified
Commit
332843f4
authored
Oct 13, 2022
by
lynn
Committed by
GitHub
Oct 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add logging for token details (#4925)
logging for token details
parent
cee32f97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
60 deletions
+67
-60
constants.ts
src/analytics/constants.ts
+1
-0
index.tsx
src/pages/TokenDetails/index.tsx
+66
-60
No files found.
src/analytics/constants.ts
View file @
332843f4
...
@@ -74,6 +74,7 @@ export enum SWAP_PRICE_UPDATE_USER_RESPONSE {
...
@@ -74,6 +74,7 @@ export enum SWAP_PRICE_UPDATE_USER_RESPONSE {
* Known pages in the app. Highest order context.
* Known pages in the app. Highest order context.
*/
*/
export
enum
PageName
{
export
enum
PageName
{
TOKEN_DETAILS_PAGE
=
'
token-details
'
,
TOKENS_PAGE
=
'
tokens-page
'
,
TOKENS_PAGE
=
'
tokens-page
'
,
POOL_PAGE
=
'
pool-page
'
,
POOL_PAGE
=
'
pool-page
'
,
SWAP_PAGE
=
'
swap-page
'
,
SWAP_PAGE
=
'
swap-page
'
,
...
...
src/pages/TokenDetails/index.tsx
View file @
332843f4
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
PageName
}
from
'
analytics/constants
'
import
{
Trace
}
from
'
analytics/Trace
'
import
{
filterTimeAtom
}
from
'
components/Tokens/state
'
import
{
filterTimeAtom
}
from
'
components/Tokens/state
'
import
{
AboutSection
}
from
'
components/Tokens/TokenDetails/About
'
import
{
AboutSection
}
from
'
components/Tokens/TokenDetails/About
'
import
AddressSection
from
'
components/Tokens/TokenDetails/AddressSection
'
import
AddressSection
from
'
components/Tokens/TokenDetails/AddressSection
'
...
@@ -124,67 +126,71 @@ export default function TokenDetails() {
...
@@ -124,67 +126,71 @@ export default function TokenDetails() {
)
)
return
(
return
(
<
TokenDetailsLayout
>
<
Trace
page=
{
PageName
.
TOKEN_DETAILS_PAGE
}
properties=
{
{
tokenAddress
,
tokenName
:
chainName
}
}
shouldLogImpression
>
{
tokenQueryData
&&
(
<
TokenDetailsLayout
>
<>
{
tokenQueryData
&&
(
<
LeftPanel
>
<>
<
BreadcrumbNavLink
to=
{
`/tokens/${chainName}`
}
>
<
LeftPanel
>
<
ArrowLeft
size=
{
14
}
/>
Tokens
<
BreadcrumbNavLink
to=
{
`/tokens/${chainName}`
}
>
</
BreadcrumbNavLink
>
<
ArrowLeft
size=
{
14
}
/>
Tokens
<
ChartSection
</
BreadcrumbNavLink
>
token=
{
tokenQueryData
}
<
ChartSection
currency=
{
token
}
token=
{
tokenQueryData
}
nativeCurrency=
{
isNative
?
nativeCurrency
:
undefined
}
currency=
{
token
}
prices=
{
prices
}
nativeCurrency=
{
isNative
?
nativeCurrency
:
undefined
}
/>
prices=
{
prices
}
<
StatsSection
/>
TVL=
{
tokenQueryData
.
market
?.
totalValueLocked
?.
value
}
<
StatsSection
volume24H=
{
tokenQueryData
.
market
?.
volume24H
?.
value
}
TVL=
{
tokenQueryData
.
market
?.
totalValueLocked
?.
value
}
priceHigh52W=
{
tokenQueryData
.
market
?.
priceHigh52W
?.
value
}
volume24H=
{
tokenQueryData
.
market
?.
volume24H
?.
value
}
priceLow52W=
{
tokenQueryData
.
market
?.
priceLow52W
?.
value
}
priceHigh52W=
{
tokenQueryData
.
market
?.
priceHigh52W
?.
value
}
/>
priceLow52W=
{
tokenQueryData
.
market
?.
priceLow52W
?.
value
}
<
Hr
/>
/>
<
AboutSection
<
Hr
/>
address=
{
tokenQueryData
.
address
??
''
}
<
AboutSection
description=
{
tokenQueryData
.
project
?.
description
}
address=
{
tokenQueryData
.
address
??
''
}
homepageUrl=
{
tokenQueryData
.
project
?.
homepageUrl
}
description=
{
tokenQueryData
.
project
?.
description
}
twitterName=
{
tokenQueryData
.
project
?.
twitterName
}
homepageUrl=
{
tokenQueryData
.
project
?.
homepageUrl
}
/>
twitterName=
{
tokenQueryData
.
project
?.
twitterName
}
<
AddressSection
address=
{
tokenQueryData
.
address
??
''
}
/>
/>
</
LeftPanel
>
<
AddressSection
address=
{
tokenQueryData
.
address
??
''
}
/>
<
RightPanel
>
</
LeftPanel
>
<
Widget
<
RightPanel
>
// A null token is still loading, and should not be overridden.
<
Widget
defaultToken=
{
token
===
null
?
undefined
:
token
??
nativeCurrency
}
// A null token is still loading, and should not be overridden.
onReviewSwapClick=
{
onReviewSwap
}
defaultToken=
{
token
===
null
?
undefined
:
token
??
nativeCurrency
}
/>
onReviewSwapClick=
{
onReviewSwap
}
{
tokenWarning
&&
<
TokenSafetyMessage
tokenAddress=
{
tokenQueryData
.
address
??
''
}
warning=
{
tokenWarning
}
/>
}
/>
<
BalanceSummary
{
tokenWarning
&&
(
tokenAmount=
{
tokenBalance
}
<
TokenSafetyMessage
tokenAddress=
{
tokenQueryData
.
address
??
''
}
warning=
{
tokenWarning
}
/>
nativeCurrencyAmount=
{
nativeCurrencyBalance
}
)
}
isNative=
{
isNative
}
<
BalanceSummary
/>
tokenAmount=
{
tokenBalance
}
</
RightPanel
>
nativeCurrencyAmount=
{
nativeCurrencyBalance
}
isNative=
{
isNative
}
/>
</
RightPanel
>
{
tokenQueryAddress
&&
(
{
tokenQueryAddress
&&
(
<
MobileBalanceSummaryFooter
<
MobileBalanceSummaryFooter
tokenAmount=
{
tokenBalance
}
tokenAmount=
{
tokenBalance
}
tokenAddress=
{
tokenQueryAddress
}
tokenAddress=
{
tokenQueryAddress
}
nativeCurrencyAmount=
{
nativeCurrencyBalance
}
nativeCurrencyAmount=
{
nativeCurrencyBalance
}
isNative=
{
isNative
}
isNative=
{
isNative
}
/>
/>
)
}
)
}
<
TokenSafetyModal
<
TokenSafetyModal
isOpen=
{
isBlockedToken
||
!!
continueSwap
}
isOpen=
{
isBlockedToken
||
!!
continueSwap
}
tokenAddress=
{
tokenQueryData
.
address
}
tokenAddress=
{
tokenQueryData
.
address
}
onContinue=
{
()
=>
onResolveSwap
(
true
)
}
onContinue=
{
()
=>
onResolveSwap
(
true
)
}
onBlocked=
{
()
=>
navigate
(
-
1
)
}
onBlocked=
{
()
=>
navigate
(
-
1
)
}
onCancel=
{
()
=>
onResolveSwap
(
false
)
}
onCancel=
{
()
=>
onResolveSwap
(
false
)
}
showCancel=
{
true
}
showCancel=
{
true
}
/>
/>
</>
</>
)
}
)
}
</
TokenDetailsLayout
>
</
TokenDetailsLayout
>
</
Trace
>
)
)
}
}
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