diff options
Diffstat (limited to 'packages/website/ts/components/wallet/wallet.tsx')
-rw-r--r-- | packages/website/ts/components/wallet/wallet.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index f80be6313..237e86306 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -1,9 +1,10 @@ -import { EtherscanLinkSuffixes, Styles, utils as sharedUtils } from '@0xproject/react-shared'; +import { constants as sharedConstants, EtherscanLinkSuffixes, Styles, utils as sharedUtils } from '@0xproject/react-shared'; import { BigNumber, errorUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import FloatingActionButton from 'material-ui/FloatingActionButton'; + import { ListItem } from 'material-ui/List'; import ActionAccountBalanceWallet from 'material-ui/svg-icons/action/account-balance-wallet'; import ContentAdd from 'material-ui/svg-icons/content/add'; @@ -12,6 +13,7 @@ import * as React from 'react'; import { Link } from 'react-router-dom'; import firstBy = require('thenby'); +import { analytics } from 'ts/utils/analytics'; import { Blockchain } from 'ts/blockchain'; import { AllowanceToggle } from 'ts/components/inputs/allowance_toggle'; import { Container } from 'ts/components/ui/container'; @@ -495,18 +497,24 @@ export class Wallet extends React.Component<WalletProps, WalletState> { } } const onClick = isWrappedEtherDirectionOpen - ? this._closeWrappedEtherActionRow.bind(this) + ? this._closeWrappedEtherActionRow.bind(this, wrappedEtherDirection) : this._openWrappedEtherActionRow.bind(this, wrappedEtherDirection); return ( <IconButton iconName={buttonIconName} labelText={buttonLabel} onClick={onClick} color={colors.mediumBlue} /> ); } private _openWrappedEtherActionRow(wrappedEtherDirection: Side): void { + const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId]; + const action = wrappedEtherDirection === Side.Deposit ? 'Wallet - Wrap ETH Opened' : 'Wallet - Unwrap WETH Opened'; + analytics.logEvent('Portal', action, networkName); this.setState({ wrappedEtherDirection, }); } - private _closeWrappedEtherActionRow(): void { + private _closeWrappedEtherActionRow(wrappedEtherDirection: Side): void { + const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId]; + const action = wrappedEtherDirection === Side.Deposit ? 'Wallet - Wrap ETH Closed' : 'Wallet - Unwrap WETH Closed'; + analytics.logEvent('Portal', action, networkName); this.setState({ wrappedEtherDirection: undefined, }); |