diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-05-08 00:12:14 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-05-08 00:18:50 +0800 |
commit | d730da8caadfd1e893c342577c079adbbc7f2164 (patch) | |
tree | b61267c8ee22d70029ad5180b562e301d0313dda /ui/app/pages/send/send-content | |
parent | 581128503c161bc3b569ca5d87e4eea8b0d15150 (diff) | |
download | tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.tar tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.tar.gz tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.tar.bz2 tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.tar.lz tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.tar.xz tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.tar.zst tangerine-wallet-browser-d730da8caadfd1e893c342577c079adbbc7f2164.zip |
Use metricsEvent in AmountMaxButton component
Diffstat (limited to 'ui/app/pages/send/send-content')
2 files changed, 15 insertions, 5 deletions
diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js index f17137c1e..e256d1442 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js @@ -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() diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js index b04d3897f..a6cb29d4c 100644 --- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js @@ -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() }) |