diff options
author | Thomas Schmidt <tomhschmidt@thomass-mbp-2.lan> | 2018-02-06 07:57:29 +0800 |
---|---|---|
committer | Thomas Schmidt <tomhschmidt@thomass-mbp-2.lan> | 2018-02-06 07:57:29 +0800 |
commit | 598ce0d40129b7426d47404a3e6ff886c2e186b9 (patch) | |
tree | ffe949a0707f8516c31817be53cf3e47119648b0 /packages/website/ts/components | |
parent | 4ddb86df53802fe5c965724d965d281528a97971 (diff) | |
download | dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.tar dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.tar.gz dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.tar.bz2 dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.tar.lz dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.tar.xz dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.tar.zst dexon-sol-tools-598ce0d40129b7426d47404a3e6ff886c2e186b9.zip |
Switch GA to React GA and add logging for Portal
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r-- | packages/website/ts/components/inputs/allowance_toggle.tsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index 45531e74b..26c693dee 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -2,6 +2,7 @@ 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'; @@ -74,7 +75,17 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS; } try { - await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits); + await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits) + .then((fulfilled: any) => { + ReactGA.event({ + category: 'Portal', + action: 'Set Allowance', + label: this.props.token.symbol, + value: newAllowanceAmountInBaseUnits, + }); + }, (rejected: any) => { + console.log(rejected); + }); await this.props.refetchTokenStateAsync(); } catch (err) { this.setState({ |