Commit 85f4cec8 authored by lynn's avatar lynn Committed by GitHub

fix: add back “NFT Sell item added” event (#5528)

* init

* fix

* fix

* remove debug
parent 5e23501d
import { useTrace } from '@uniswap/analytics'
import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { OpacityHoverState } from 'components/Common' import { OpacityHoverState } from 'components/Common'
import { useNftBalanceQuery } from 'graphql/data/nft/NftBalance' import { useNftBalanceQuery } from 'graphql/data/nft/NftBalance'
...@@ -214,11 +217,17 @@ const OwnerContainer = ({ asset }: { asset: WalletAsset }) => { ...@@ -214,11 +217,17 @@ const OwnerContainer = ({ asset }: { asset: WalletAsset }) => {
() => (USDValue ? USDValue * asset.floor_sell_order_price : undefined), () => (USDValue ? USDValue * asset.floor_sell_order_price : undefined),
[USDValue, asset.floor_sell_order_price] [USDValue, asset.floor_sell_order_price]
) )
const trace = useTrace()
const goToListPage = () => { const goToListPage = () => {
resetSellAssets() resetSellAssets()
navigate('/nfts/profile') navigate('/nfts/profile')
selectSellAsset(asset) selectSellAsset(asset)
sendAnalyticsEvent(EventName.NFT_SELL_ITEM_ADDED, {
collection_address: asset.asset_contract.address,
token_id: asset.tokenId,
...trace,
})
setSellPageState(ProfilePageStateType.LISTING) setSellPageState(ProfilePageStateType.LISTING)
} }
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { useTrace } from '@uniswap/analytics'
import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events'
import { MouseoverTooltip } from 'components/Tooltip' import { MouseoverTooltip } from 'components/Tooltip'
import Tooltip from 'components/Tooltip' import Tooltip from 'components/Tooltip'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
...@@ -65,11 +68,20 @@ export const ViewMyNftsAsset = ({ ...@@ -65,11 +68,20 @@ export const ViewMyNftsAsset = ({
const [showTooltip, setShowTooltip] = useState(false) const [showTooltip, setShowTooltip] = useState(false)
const isSelectedRef = useRef(isSelected) const isSelectedRef = useRef(isSelected)
const trace = useTrace()
const onCardClick = () => handleSelect(isSelected) const onCardClick = () => handleSelect(isSelected)
const handleSelect = (removeAsset: boolean) => { const handleSelect = (removeAsset: boolean) => {
removeAsset ? removeSellAsset(asset) : selectSellAsset(asset) if (removeAsset) {
removeSellAsset(asset)
} else {
selectSellAsset(asset)
sendAnalyticsEvent(EventName.NFT_SELL_ITEM_ADDED, {
collection_address: asset.asset_contract.address,
token_id: asset.tokenId,
...trace,
})
}
if ( if (
!cartExpanded && !cartExpanded &&
!sellAssets.find( !sellAssets.find(
......
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