diff options
Diffstat (limited to 'packages/website/ts/components/inputs')
-rw-r--r-- | packages/website/ts/components/inputs/allowance_toggle.tsx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index 7fe303cf4..6831fee48 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -3,12 +3,12 @@ import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import Toggle from 'material-ui/Toggle'; import * as React from 'react'; -import * as ReactGA from 'react-ga'; import { Blockchain } from 'ts/blockchain'; import { Dispatcher } from 'ts/redux/dispatcher'; import { BalanceErrs, Token, TokenState } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { errorReporter } from 'ts/utils/error_reporter'; +import { analytics } from 'ts/utils/analytics'; import { utils } from 'ts/utils/utils'; const DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS = new BigNumber(2).pow(256).minus(1); @@ -81,20 +81,10 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow const eventLabel = `${this.props.token.symbol}-${networkName}`; try { await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits); - ReactGA.event({ - category: 'Portal', - action: 'Set Allowance Success', - label: eventLabel, - value: newAllowanceAmountInBaseUnits.toNumber(), - }); + analytics.logEvent('Portal', 'Set Allowance Success', eventLabel, newAllowanceAmountInBaseUnits.toNumber()); await this.props.refetchTokenStateAsync(); } catch (err) { - ReactGA.event({ - category: 'Portal', - action: 'Set Allowance Failure', - label: eventLabel, - value: newAllowanceAmountInBaseUnits.toNumber(), - }); + analytics.logEvent('Portal', 'Set Allowance Failure', eventLabel, newAllowanceAmountInBaseUnits.toNumber()); this.setState({ isSpinnerVisible: false, }); |