aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-21 05:26:00 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-21 05:26:00 +0800
commiteca63b1a5815c61901453837f9c2b737fa82eb20 (patch)
tree7763d95f1922f6c16848a8b506384e6e9992260b /packages/instant/src/components
parent2bda6dd719d748a4bfa5ff8e23e97924e0258af1 (diff)
parentba41fc9275bebe17577f87d72f54b7e7dc420acc (diff)
downloaddexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.gz
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.bz2
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.lz
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.xz
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.zst
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.zip
Merge branch 'development' into feature/header-tweaks
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/zero_ex_instant_container.tsx13
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx14
2 files changed, 27 insertions, 0 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx
index 698bfef17..47c938472 100644
--- a/packages/instant/src/components/zero_ex_instant_container.tsx
+++ b/packages/instant/src/components/zero_ex_instant_container.tsx
@@ -1,5 +1,7 @@
import * as React from 'react';
+import PoweredByLogo from '../assets/powered_by_0x.svg';
+import { ZERO_EX_SITE_URL } from '../constants';
import { AvailableERC20TokenSelector } from '../containers/available_erc20_token_selector';
import { ConnectedBuyOrderProgressOrPaymentMethod } from '../containers/connected_buy_order_progress_or_payment_method';
import { CurrentStandardSlidingPanel } from '../containers/current_standard_sliding_panel';
@@ -64,6 +66,17 @@ export class ZeroExInstantContainer extends React.Component<{}, ZeroExInstantCon
</SlidingPanel>
<CurrentStandardSlidingPanel />
</Container>
+ <Container
+ display={{ sm: 'none', default: 'block' }}
+ marginTop="10px"
+ marginLeft="auto"
+ marginRight="auto"
+ width="140px"
+ >
+ <a href={ZERO_EX_SITE_URL} target="_blank">
+ <PoweredByLogo />
+ </a>
+ </Container>
</Container>
</React.Fragment>
);
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index 8be53ee20..9435d8c7c 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -12,6 +12,7 @@ import { DEFAULT_STATE, DefaultState, State } from '../redux/reducer';
import { store, Store } from '../redux/store';
import { fonts } from '../style/fonts';
import { AccountState, AffiliateInfo, AssetMetaData, Network, OrderSource } from '../types';
+import { analytics, disableAnalytics } from '../util/analytics';
import { assetUtils } from '../util/asset';
import { errorFlasher } from '../util/error_flasher';
import { gasPriceEstimator } from '../util/gas_price_estimator';
@@ -36,6 +37,7 @@ export interface ZeroExInstantProviderOptionalProps {
additionalAssetMetaDataMap: ObjectMap<AssetMetaData>;
networkId: Network;
affiliateInfo: AffiliateInfo;
+ shouldDisableAnalyticsTracking: boolean;
}
export class ZeroExInstantProvider extends React.Component<ZeroExInstantProviderProps> {
@@ -121,6 +123,18 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
gasPriceEstimator.getGasInfoAsync();
// tslint:disable-next-line:no-floating-promises
this._flashErrorIfWrongNetwork();
+
+ // Analytics
+ disableAnalytics(this.props.shouldDisableAnalyticsTracking || false);
+ analytics.addEventProperties({
+ embeddedHost: window.location.host,
+ embeddedUrl: window.location.href,
+ networkId: state.network,
+ providerName: state.providerState.name,
+ gitSha: process.env.GIT_SHA,
+ npmVersion: process.env.NPM_PACKAGE_VERSION,
+ });
+ analytics.trackInstantOpened();
}
public componentWillUnmount(): void {
if (this._accountUpdateHeartbeat) {