Commit 332843f4 authored by lynn's avatar lynn Committed by GitHub

fix: add logging for token details (#4925)

logging for token details
parent cee32f97
...@@ -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',
......
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,6 +126,7 @@ export default function TokenDetails() { ...@@ -124,6 +126,7 @@ export default function TokenDetails() {
) )
return ( return (
<Trace page={PageName.TOKEN_DETAILS_PAGE} properties={{ tokenAddress, tokenName: chainName }} shouldLogImpression>
<TokenDetailsLayout> <TokenDetailsLayout>
{tokenQueryData && ( {tokenQueryData && (
<> <>
...@@ -158,7 +161,9 @@ export default function TokenDetails() { ...@@ -158,7 +161,9 @@ export default function TokenDetails() {
defaultToken={token === null ? undefined : token ?? nativeCurrency} defaultToken={token === null ? undefined : token ?? nativeCurrency}
onReviewSwapClick={onReviewSwap} onReviewSwapClick={onReviewSwap}
/> />
{tokenWarning && <TokenSafetyMessage tokenAddress={tokenQueryData.address ?? ''} warning={tokenWarning} />} {tokenWarning && (
<TokenSafetyMessage tokenAddress={tokenQueryData.address ?? ''} warning={tokenWarning} />
)}
<BalanceSummary <BalanceSummary
tokenAmount={tokenBalance} tokenAmount={tokenBalance}
nativeCurrencyAmount={nativeCurrencyBalance} nativeCurrencyAmount={nativeCurrencyBalance}
...@@ -186,5 +191,6 @@ export default function TokenDetails() { ...@@ -186,5 +191,6 @@ export default function TokenDetails() {
</> </>
)} )}
</TokenDetailsLayout> </TokenDetailsLayout>
</Trace>
) )
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment