diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-20 04:29:54 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-20 04:29:54 +0800 |
commit | a75d6531f207aac8aeefa94bb44fa96a5b295998 (patch) | |
tree | fc1c581f4c35e188b0a16461936b8d0e3323bfe6 /packages/website/ts/components/wallet/wallet.tsx | |
parent | bdd299dd9ee4699ccf5a4ab648e721e03ab2a139 (diff) | |
parent | da69ddc19b29cfca05d28084b196324e121987ea (diff) | |
download | dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.gz dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.bz2 dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.lz dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.xz dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.zst dexon-0x-contracts-a75d6531f207aac8aeefa94bb44fa96a5b295998.zip |
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into bug/website/onboarding-improvements
Diffstat (limited to 'packages/website/ts/components/wallet/wallet.tsx')
-rw-r--r-- | packages/website/ts/components/wallet/wallet.tsx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index b6d22c99a..ac2fe0d31 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -1,9 +1,15 @@ -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'; @@ -34,6 +40,7 @@ import { TokenStateByAddress, WebsitePaths, } from 'ts/types'; +import { analytics } from 'ts/utils/analytics'; import { constants } from 'ts/utils/constants'; import { utils } from 'ts/utils/utils'; import { styles as walletItemStyles } from 'ts/utils/wallet_item_styles'; @@ -489,18 +496,26 @@ 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, }); |