Commit 53b9a847 authored by lynn's avatar lynn Committed by GitHub

fix: add back previously deleted trending row selected event (#5512)

* init

* upgrade analytics pkg
parent 04f91279
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 { LoadingBubble } from 'components/Tokens/loading'
import { useWindowSize } from 'hooks/useWindowSize' import { useWindowSize } from 'hooks/useWindowSize'
import { useIsMobile } from 'nft/hooks' import { useIsMobile } from 'nft/hooks'
...@@ -99,6 +102,7 @@ export function Table<D extends Record<string, unknown>>({ ...@@ -99,6 +102,7 @@ export function Table<D extends Record<string, unknown>>({
...props ...props
}: TableProps<D>) { }: TableProps<D>) {
const theme = useTheme() const theme = useTheme()
const { chainId } = useWeb3React()
const { width } = useWindowSize() const { width } = useWindowSize()
const isMobile = useIsMobile() const isMobile = useIsMobile()
...@@ -183,37 +187,45 @@ export function Table<D extends Record<string, unknown>>({ ...@@ -183,37 +187,45 @@ export function Table<D extends Record<string, unknown>>({
prepareRow(row) prepareRow(row)
return ( return (
<StyledRow <TraceEvent
{...row.getRowProps()} events={[BrowserEvent.onClick]}
key={row.id} name={EventName.NFT_TRENDING_ROW_SELECTED}
onClick={() => navigate(`/nfts/collection/${row.original.collection.address}`)} properties={{ collection_address: row.original.collection.address, chain_id: chainId }}
element={ElementName.NFT_TRENDING_ROW}
key={i}
> >
{row.cells.map((cell, cellIndex) => { <StyledRow
return ( {...row.getRowProps()}
<td key={row.id}
className={styles.td} onClick={() => navigate(`/nfts/collection/${row.original.collection.address}`)}
{...cell.getCellProps()} >
key={cellIndex} {row.cells.map((cell, cellIndex) => {
style={{ return (
maxWidth: cellIndex === 0 ? (isMobile ? MOBILE_CELL_WIDTH : DESKTOP_CELL_WIDTH) : CELL_WIDTH, <td
}} className={styles.td}
> {...cell.getCellProps()}
{cellIndex === 0 ? ( key={cellIndex}
<RankCellContainer> style={{
{!isMobile && ( maxWidth: cellIndex === 0 ? (isMobile ? MOBILE_CELL_WIDTH : DESKTOP_CELL_WIDTH) : CELL_WIDTH,
<ThemedText.BodySecondary fontSize="14px" lineHeight="20px"> }}
{i + 1} >
</ThemedText.BodySecondary> {cellIndex === 0 ? (
)} <RankCellContainer>
{cell.render('Cell')} {!isMobile && (
</RankCellContainer> <ThemedText.BodySecondary fontSize="14px" lineHeight="20px">
) : ( {i + 1}
cell.render('Cell') </ThemedText.BodySecondary>
)} )}
</td> {cell.render('Cell')}
) </RankCellContainer>
})} ) : (
</StyledRow> cell.render('Cell')
)}
</td>
)
})}
</StyledRow>
</TraceEvent>
) )
})} })}
</tbody> </tbody>
......
...@@ -4135,10 +4135,10 @@ ...@@ -4135,10 +4135,10 @@
resolved "https://registry.yarnpkg.com/@uniswap/analytics-events/-/analytics-events-1.1.0.tgz#459236d86f864039c3931d21ba80f41575d2ce4e" resolved "https://registry.yarnpkg.com/@uniswap/analytics-events/-/analytics-events-1.1.0.tgz#459236d86f864039c3931d21ba80f41575d2ce4e"
integrity sha512-ZJ99dLhJ4q2c0g0PoMxDPbeC010DrdIBLf7jnUsTf/hYm2LfHryr31Sv204xNO7rWVWHi1dk6jdab8DdBnHgPA== integrity sha512-ZJ99dLhJ4q2c0g0PoMxDPbeC010DrdIBLf7jnUsTf/hYm2LfHryr31Sv204xNO7rWVWHi1dk6jdab8DdBnHgPA==
"@uniswap/analytics@1.1.1": "@uniswap/analytics@1.2.0":
version "1.1.1" version "1.2.0"
resolved "https://registry.yarnpkg.com/@uniswap/analytics/-/analytics-1.1.1.tgz#af9741054f2df61fb595cb3761762bb0a24f8a86" resolved "https://registry.yarnpkg.com/@uniswap/analytics/-/analytics-1.2.0.tgz#38452f31ca249903e0bdc8739f42ed437fdc4911"
integrity sha512-pRoagKfji+Xwh4YuS1ns0mfBfXwUWJlf7H+D3vzIMspTNdJVPG44G8hGM0JN4f9H9+JerFyC+4dXrmLL6rnh+w== integrity sha512-oO9+mhDJVGm2tqFic6PVQ8v75snbLaGymqs3wauwMXrdy4fMeNSCrKfnaGAKElRUYus3eDLMy/cbXy3Md3iRZA==
dependencies: dependencies:
"@amplitude/analytics-browser" "^1.5.8" "@amplitude/analytics-browser" "^1.5.8"
react "^18.2.0" react "^18.2.0"
......
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