From 53b9a847ca590280bc404e3b8270afd1f5426d27 Mon Sep 17 00:00:00 2001 From: lynn <41491154+lynnshaoyu@users.noreply.github.com> Date: Fri, 2 Dec 2022 10:45:13 -0500 Subject: [PATCH] fix: add back previously deleted trending row selected event (#5512) * init * upgrade analytics pkg --- package.json | 2 +- src/nft/components/explore/Table.tsx | 72 ++++++++++++++++------------ yarn.lock | 8 ++-- 3 files changed, 47 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index f7ef0cdc91..2bb1961a2f 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "@reduxjs/toolkit": "^1.6.1", "@types/react-relay": "^13.0.2", "@types/react-window-infinite-loader": "^1.0.6", - "@uniswap/analytics": "1.1.1", + "@uniswap/analytics": "1.2.0", "@uniswap/analytics-events": "1.1.0", "@uniswap/conedison": "^1.1.0", "@uniswap/governance": "^1.0.2", diff --git a/src/nft/components/explore/Table.tsx b/src/nft/components/explore/Table.tsx index 051a893d88..d46a2e2322 100644 --- a/src/nft/components/explore/Table.tsx +++ b/src/nft/components/explore/Table.tsx @@ -1,3 +1,6 @@ +import { TraceEvent } from '@uniswap/analytics' +import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' +import { useWeb3React } from '@web3-react/core' import { LoadingBubble } from 'components/Tokens/loading' import { useWindowSize } from 'hooks/useWindowSize' import { useIsMobile } from 'nft/hooks' @@ -99,6 +102,7 @@ export function Table>({ ...props }: TableProps) { const theme = useTheme() + const { chainId } = useWeb3React() const { width } = useWindowSize() const isMobile = useIsMobile() @@ -183,37 +187,45 @@ export function Table>({ prepareRow(row) return ( - navigate(`/nfts/collection/${row.original.collection.address}`)} + - {row.cells.map((cell, cellIndex) => { - return ( - - {cellIndex === 0 ? ( - - {!isMobile && ( - - {i + 1} - - )} - {cell.render('Cell')} - - ) : ( - cell.render('Cell') - )} - - ) - })} - + navigate(`/nfts/collection/${row.original.collection.address}`)} + > + {row.cells.map((cell, cellIndex) => { + return ( + + {cellIndex === 0 ? ( + + {!isMobile && ( + + {i + 1} + + )} + {cell.render('Cell')} + + ) : ( + cell.render('Cell') + )} + + ) + })} + + ) })} diff --git a/yarn.lock b/yarn.lock index 6fb4e56958..99293fbe18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4135,10 +4135,10 @@ resolved "https://registry.yarnpkg.com/@uniswap/analytics-events/-/analytics-events-1.1.0.tgz#459236d86f864039c3931d21ba80f41575d2ce4e" integrity sha512-ZJ99dLhJ4q2c0g0PoMxDPbeC010DrdIBLf7jnUsTf/hYm2LfHryr31Sv204xNO7rWVWHi1dk6jdab8DdBnHgPA== -"@uniswap/analytics@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@uniswap/analytics/-/analytics-1.1.1.tgz#af9741054f2df61fb595cb3761762bb0a24f8a86" - integrity sha512-pRoagKfji+Xwh4YuS1ns0mfBfXwUWJlf7H+D3vzIMspTNdJVPG44G8hGM0JN4f9H9+JerFyC+4dXrmLL6rnh+w== +"@uniswap/analytics@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@uniswap/analytics/-/analytics-1.2.0.tgz#38452f31ca249903e0bdc8739f42ed437fdc4911" + integrity sha512-oO9+mhDJVGm2tqFic6PVQ8v75snbLaGymqs3wauwMXrdy4fMeNSCrKfnaGAKElRUYus3eDLMy/cbXy3Md3iRZA== dependencies: "@amplitude/analytics-browser" "^1.5.8" react "^18.2.0"