diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/.DS_Store | bin | 0 -> 8196 bytes | |||
-rw-r--r-- | packages/instant/src/components/buy_order_progress.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/components/instant_heading.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/components/order_details.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/components/payment_method.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/redux/analytics_middleware.ts | 18 | ||||
-rw-r--r-- | packages/instant/src/util/analytics.ts | 6 |
7 files changed, 23 insertions, 9 deletions
diff --git a/packages/instant/.DS_Store b/packages/instant/.DS_Store Binary files differnew file mode 100644 index 000000000..9a0cceca6 --- /dev/null +++ b/packages/instant/.DS_Store diff --git a/packages/instant/src/components/buy_order_progress.tsx b/packages/instant/src/components/buy_order_progress.tsx index 6568de91b..a19f5a4d0 100644 --- a/packages/instant/src/components/buy_order_progress.tsx +++ b/packages/instant/src/components/buy_order_progress.tsx @@ -21,7 +21,7 @@ export const BuyOrderProgress: React.StatelessComponent<BuyOrderProgressProps> = const hasEnded = buyOrderState.processState !== OrderProcessState.Processing; const expectedTimeMs = progress.expectedEndTimeUnix - progress.startTimeUnix; return ( - <Container padding="20px 20px 0px 20px" width="100%"> + <Container width="100%" padding="20px 20px 0px 20px"> <Container marginBottom="5px"> <TimeCounter estimatedTimeMs={expectedTimeMs} hasEnded={hasEnded} key={progress.startTimeUnix} /> </Container> diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx index 808c6dc7f..117f9dd5f 100644 --- a/packages/instant/src/components/instant_heading.tsx +++ b/packages/instant/src/components/instant_heading.tsx @@ -32,7 +32,7 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> { public render(): React.ReactNode { const iconOrAmounts = this._renderIcon() || this._renderAmountsSection(); return ( - <Container backgroundColor={ColorOption.primaryColor} padding="20px" width="100%"> + <Container backgroundColor={ColorOption.primaryColor} width="100%" padding="20px"> <Container marginBottom="5px"> <Text letterSpacing="1px" diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx index 5fc956e1c..a8e0e2513 100644 --- a/packages/instant/src/components/order_details.tsx +++ b/packages/instant/src/components/order_details.tsx @@ -34,7 +34,7 @@ export class OrderDetails extends React.Component<OrderDetailsProps> { ? assetEthBaseUnitAmount.div(selectedAssetUnitAmount).ceil() : undefined; return ( - <Container padding="20px" width="100%" flexGrow={1}> + <Container width="100%" flexGrow={1} padding="20px 20px 0px 20px"> <Container marginBottom="10px"> <Text letterSpacing="1px" diff --git a/packages/instant/src/components/payment_method.tsx b/packages/instant/src/components/payment_method.tsx index 4efe5b28e..603788748 100644 --- a/packages/instant/src/components/payment_method.tsx +++ b/packages/instant/src/components/payment_method.tsx @@ -26,7 +26,7 @@ export interface PaymentMethodProps { export class PaymentMethod extends React.Component<PaymentMethodProps> { public render(): React.ReactNode { return ( - <Container padding="20px" width="100%" height="133px"> + <Container width="100%" height="120px" padding="20px 20px 0px 20px"> <Container marginBottom="12px"> <Flex justify="space-between"> <Text diff --git a/packages/instant/src/redux/analytics_middleware.ts b/packages/instant/src/redux/analytics_middleware.ts index 47876ca2d..3f7a51707 100644 --- a/packages/instant/src/redux/analytics_middleware.ts +++ b/packages/instant/src/redux/analytics_middleware.ts @@ -1,10 +1,11 @@ +import { AssetProxyId } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import * as _ from 'lodash'; import { Middleware } from 'redux'; import { ETH_DECIMALS } from '../constants'; import { AccountState, StandardSlidingPanelContent } from '../types'; -import { analytics } from '../util/analytics'; +import { analytics, AnalyticsEventOptions } from '../util/analytics'; import { Action, ActionTypes } from './actions'; @@ -29,9 +30,11 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction if (didJustTurnReady) { analytics.trackAccountReady(ethAddress); analytics.addUserProperties({ lastKnownEthAddress: ethAddress }); + analytics.addEventProperties({ ethAddress }); } else if (didJustUpdateAddress) { analytics.trackAccountAddressChanged(ethAddress); analytics.addUserProperties({ lastKnownEthAddress: ethAddress }); + analytics.addEventProperties({ ethAddress }); } } break; @@ -51,7 +54,8 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction curAccount.ethBalanceInWei, ETH_DECIMALS, ).toString(); - analytics.addUserProperties({ ethBalanceInUnitAmount }); + analytics.addUserProperties({ lastEthBalanceInUnitAmount: ethBalanceInUnitAmount }); + analytics.addEventProperties({ ethBalanceInUnitAmount }); } break; case ActionTypes.UPDATE_SELECTED_ASSET: @@ -63,10 +67,16 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction assetName, assetData, }); - analytics.addEventProperties({ + + const selectedAssetEventProperties: AnalyticsEventOptions = { selectedAssetName: assetName, selectedAssetData: assetData, - }); + }; + if (selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20) { + selectedAssetEventProperties.selectedAssetDecimals = selectedAsset.metaData.decimals; + selectedAssetEventProperties.selectedAssetSymbol = selectedAsset.metaData.symbol; + } + analytics.addEventProperties(selectedAssetEventProperties); } break; case ActionTypes.SET_AVAILABLE_ASSETS: diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index b7cbfa82a..6da37bedb 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -97,11 +97,13 @@ const buyQuoteEventProperties = (buyQuote: BuyQuote) => { export interface AnalyticsUserOptions { lastKnownEthAddress?: string; - ethBalanceInUnitAmount?: string; + lastEthBalanceInUnitAmount?: string; } export interface AnalyticsEventOptions { embeddedHost?: string; embeddedUrl?: string; + ethBalanceInUnitAmount?: string; + ethAddress?: string; networkId?: number; providerName?: string; gitSha?: string; @@ -112,7 +114,9 @@ export interface AnalyticsEventOptions { affiliateFeePercent?: number; numberAvailableAssets?: number; selectedAssetName?: string; + selectedAssetSymbol?: string; selectedAssetData?: string; + selectedAssetDecimals?: number; } export enum TokenSelectorClosedVia { ClickedX = 'Clicked X', |