Commit ab9f2af0 authored by lynn's avatar lynn Committed by GitHub

fix: modify mini portfolio pools row event properties (#6248)

* init

* use memo
parent 67b405dd
...@@ -100,6 +100,16 @@ function PositionListItem({ positionInfo }: { positionInfo: PositionInfo }) { ...@@ -100,6 +100,16 @@ function PositionListItem({ positionInfo }: { positionInfo: PositionInfo }) {
toggleWalletDrawer() toggleWalletDrawer()
navigate('/pool/' + details.tokenId) navigate('/pool/' + details.tokenId)
}, [walletChainId, chainId, connector, toggleWalletDrawer, navigate, details.tokenId]) }, [walletChainId, chainId, connector, toggleWalletDrawer, navigate, details.tokenId])
const analyticsEventProperties = useMemo(
() => ({
chain_id: chainId,
pool_token_0_symbol: pool.token0.symbol,
pool_token_1_symbol: pool.token1.symbol,
pool_token_0_address: pool.token0.address,
pool_token_1_address: pool.token1.address,
}),
[chainId, pool.token0.address, pool.token0.symbol, pool.token1.address, pool.token1.symbol]
)
const containsURL = useMemo( const containsURL = useMemo(
() => () =>
...@@ -118,7 +128,7 @@ function PositionListItem({ positionInfo }: { positionInfo: PositionInfo }) { ...@@ -118,7 +128,7 @@ function PositionListItem({ positionInfo }: { positionInfo: PositionInfo }) {
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED} name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.MINI_PORTFOLIO_POOLS_ROW} element={InterfaceElementName.MINI_PORTFOLIO_POOLS_ROW}
properties={{ chain_id: chainId, pool_token_0: pool.token0, pool_token_1: pool.token1 }} properties={analyticsEventProperties}
> >
<PortfolioRow <PortfolioRow
onClick={onClick} onClick={onClick}
......
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