mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Use metricsEvent in AmountMaxButton component
This commit is contained in:
parent
581128503c
commit
d730da8caa
@ -15,6 +15,7 @@ export default class AmountMaxButton extends Component {
|
||||
|
||||
static contextTypes = {
|
||||
t: PropTypes.func,
|
||||
metricsEvent: PropTypes.func,
|
||||
}
|
||||
|
||||
setMaxAmount () {
|
||||
@ -35,11 +36,15 @@ export default class AmountMaxButton extends Component {
|
||||
}
|
||||
|
||||
onMaxClick = (event) => {
|
||||
const { setMaxModeTo, selectedToken } = this.props
|
||||
const { setMaxModeTo } = this.props
|
||||
const { metricsEvent } = this.context
|
||||
|
||||
fetch('https://chromeextensionmm.innocraft.cloud/piwik.php?idsite=1&rec=1&e_c=send&e_a=amountMax&e_n=' + (selectedToken ? 'token' : 'eth'), {
|
||||
'headers': {},
|
||||
'method': 'GET',
|
||||
metricsEvent({
|
||||
eventOpts: {
|
||||
category: 'Transactions',
|
||||
action: 'Edit Screen',
|
||||
name: 'Clicked "Amount Max"',
|
||||
},
|
||||
})
|
||||
|
||||
event.preventDefault()
|
||||
|
@ -26,7 +26,12 @@ describe('AmountMaxButton Component', function () {
|
||||
setAmountToMax={propsMethodSpies.setAmountToMax}
|
||||
setMaxModeTo={propsMethodSpies.setMaxModeTo}
|
||||
tokenBalance={'mockTokenBalance'}
|
||||
/>, { context: { t: str => str + '_t' } })
|
||||
/>, {
|
||||
context: {
|
||||
t: str => str + '_t',
|
||||
metricsEvent: () => {},
|
||||
},
|
||||
})
|
||||
instance = wrapper.instance()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user