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 selectedTokenAddress = useSelector((state) => state.metamask.selectedTokenAddress)
|
||||
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 {
|
||||
currency: primaryCurrency,
|
||||
@ -56,25 +69,13 @@ const AssetList = () => {
|
||||
<TokenList
|
||||
onTokenClick={(tokenAddress) => {
|
||||
dispatch(setSelectedToken(tokenAddress))
|
||||
metricsEvent({
|
||||
eventOpts: {
|
||||
category: 'Navigation',
|
||||
action: 'Token Menu',
|
||||
name: 'Clicked Token',
|
||||
},
|
||||
})
|
||||
selectTokenEvent()
|
||||
}}
|
||||
/>
|
||||
<AddTokenButton
|
||||
onClick={() => {
|
||||
history.push(ADD_TOKEN_ROUTE)
|
||||
metricsEvent({
|
||||
eventOpts: {
|
||||
category: 'Navigation',
|
||||
action: 'Token Menu',
|
||||
name: 'Clicked "Add Token"',
|
||||
},
|
||||
})
|
||||
addTokenEvent()
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user