diff options
Diffstat (limited to 'ui/app/components/send/send-content/send-gas-row')
-rw-r--r-- | ui/app/components/send/send-content/send-gas-row/send-gas-row.component.js | 26 | ||||
-rw-r--r-- | ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js | 2 |
2 files changed, 25 insertions, 3 deletions
diff --git a/ui/app/components/send/send-content/send-gas-row/send-gas-row.component.js b/ui/app/components/send/send-content/send-gas-row/send-gas-row.component.js index 50337e0bf..bf7446626 100644 --- a/ui/app/components/send/send-content/send-gas-row/send-gas-row.component.js +++ b/ui/app/components/send/send-content/send-gas-row/send-gas-row.component.js @@ -27,11 +27,22 @@ export default class SendGasRow extends Component { static contextTypes = { t: PropTypes.func, - } + metricsEvent: PropTypes.func, + }; renderAdvancedOptionsButton () { + const { metricsEvent } = this.context const { showCustomizeGasModal } = this.props - return <div className="advanced-gas-options-btn" onClick={() => showCustomizeGasModal()}> + return <div className="advanced-gas-options-btn" onClick={() => { + metricsEvent({ + eventOpts: { + category: 'Transactions', + action: 'Edit Screen', + name: 'Clicked "Advanced Options"', + }, + }) + showCustomizeGasModal() + }}> { this.context.t('advancedOptions') } </div> } @@ -53,12 +64,23 @@ export default class SendGasRow extends Component { gasLimit, insufficientBalance, } = this.props + const { metricsEvent } = this.context const gasPriceButtonGroup = <div> <GasPriceButtonGroup className="gas-price-button-group--small" showCheck={false} {...gasPriceButtonGroupProps} + handleGasPriceSelection={(...args) => { + metricsEvent({ + eventOpts: { + category: 'Transactions', + action: 'Edit Screen', + name: 'Changed Gas Button', + }, + }) + gasPriceButtonGroupProps.handleGasPriceSelection(...args) + }} /> { this.renderAdvancedOptionsButton() } </div> diff --git a/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js b/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js index 059c6cdd3..08f26854e 100644 --- a/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js +++ b/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js @@ -30,7 +30,7 @@ describe('SendGasRow Component', function () { someGasPriceButtonGroupProp: 'foo', anotherGasPriceButtonGroupProp: 'bar', }} - />, { context: { t: str => str + '_t' } }) + />, { context: { t: str => str + '_t', metricsEvent: () => ({}) } }) }) afterEach(() => { |