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 { OpacityHoverState } from 'components/Common'
import { useNftBalanceQuery } from 'graphql/data/nft/NftBalance'
......@@ -214,11 +217,17 @@ const OwnerContainer = ({ asset }: { asset: WalletAsset }) => {
() => (USDValue ? USDValue * asset.floor_sell_order_price : undefined),
[USDValue, asset.floor_sell_order_price]
)
const trace = useTrace()
const goToListPage = () => {
resetSellAssets()
navigate('/nfts/profile')
selectSellAsset(asset)
sendAnalyticsEvent(EventName.NFT_SELL_ITEM_ADDED, {
collection_address: asset.asset_contract.address,
token_id: asset.tokenId,
...trace,
})
setSellPageState(ProfilePageStateType.LISTING)
}
......
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 Tooltip from 'components/Tooltip'
import { Box } from 'nft/components/Box'
......@@ -65,11 +68,20 @@ export const ViewMyNftsAsset = ({
const [showTooltip, setShowTooltip] = useState(false)
const isSelectedRef = useRef(isSelected)
const trace = useTrace()
const onCardClick = () => handleSelect(isSelected)
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 (
!cartExpanded &&
!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