mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix AssetList
metric events (#8639)
The metric events in the `AssetList` component were using the `useMetricEvent` hook incorrectly.
This commit is contained in:
parent
f9ea9b541a
commit
57531ad100
@ -18,7 +18,20 @@ const AssetList = () => {
|
|||||||
const selectedAccountBalance = useSelector((state) => getCurrentAccountWithSendEtherInfo(state).balance)
|
const selectedAccountBalance = useSelector((state) => getCurrentAccountWithSendEtherInfo(state).balance)
|
||||||
const selectedTokenAddress = useSelector((state) => state.metamask.selectedTokenAddress)
|
const selectedTokenAddress = useSelector((state) => state.metamask.selectedTokenAddress)
|
||||||
const showFiat = useSelector(getShouldShowFiat)
|
const showFiat = useSelector(getShouldShowFiat)
|
||||||
const metricsEvent = useMetricEvent()
|
const selectTokenEvent = useMetricEvent({
|
||||||
|
eventOpts: {
|
||||||
|
category: 'Navigation',
|
||||||
|
action: 'Token Menu',
|
||||||
|
name: 'Clicked Token',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const addTokenEvent = useMetricEvent({
|
||||||
|
eventOpts: {
|
||||||
|
category: 'Navigation',
|
||||||
|
action: 'Token Menu',
|
||||||
|
name: 'Clicked "Add Token"',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const {
|
const {
|
||||||
currency: primaryCurrency,
|
currency: primaryCurrency,
|
||||||
@ -56,25 +69,13 @@ const AssetList = () => {
|
|||||||
<TokenList
|
<TokenList
|
||||||
onTokenClick={(tokenAddress) => {
|
onTokenClick={(tokenAddress) => {
|
||||||
dispatch(setSelectedToken(tokenAddress))
|
dispatch(setSelectedToken(tokenAddress))
|
||||||
metricsEvent({
|
selectTokenEvent()
|
||||||
eventOpts: {
|
|
||||||
category: 'Navigation',
|
|
||||||
action: 'Token Menu',
|
|
||||||
name: 'Clicked Token',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<AddTokenButton
|
<AddTokenButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push(ADD_TOKEN_ROUTE)
|
history.push(ADD_TOKEN_ROUTE)
|
||||||
metricsEvent({
|
addTokenEvent()
|
||||||
eventOpts: {
|
|
||||||
category: 'Navigation',
|
|
||||||
action: 'Token Menu',
|
|
||||||
name: 'Clicked "Add Token"',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user