1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Add metrics events for Wyre and CoinSwitch (#8677)

This commit is contained in:
Whymarrh Whitby 2020-05-28 13:54:52 -02:30 committed by GitHub
parent f8137b7a66
commit 93c2184bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ import Button from '../../../ui/button'
export default class DepositEtherModal extends Component {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func.isRequired,
}
static propTypes = {
@ -141,7 +142,16 @@ export default class DepositEtherModal extends Component {
title: this.context.t('buyWithWyre'),
text: this.context.t('buyWithWyreDescription'),
buttonLabel: this.context.t('continueToWyre'),
onButtonClick: () => toWyre(address),
onButtonClick: () => {
this.context.metricsEvent({
eventOpts: {
category: 'Accounts',
action: 'Deposit Ether',
name: 'Click buy Ether via Wyre',
},
})
toWyre(address)
},
hide: isTestNetwork,
})}
{this.renderRow({
@ -157,7 +167,16 @@ export default class DepositEtherModal extends Component {
title: this.context.t('buyCoinSwitch'),
text: this.context.t('buyCoinSwitchExplainer'),
buttonLabel: this.context.t('continueToCoinSwitch'),
onButtonClick: () => toCoinSwitch(address),
onButtonClick: () => {
this.context.metricsEvent({
eventOpts: {
category: 'Accounts',
action: 'Deposit Ether',
name: 'Click buy Ether via CoinSwitch',
},
})
toCoinSwitch(address)
},
hide: isTestNetwork,
})}
</div>