aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/constants.ts3
-rw-r--r--packages/website/ts/utils/style.ts3
-rw-r--r--packages/website/ts/utils/utils.ts9
3 files changed, 14 insertions, 1 deletions
diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts
index f8710b349..9dc1d492c 100644
--- a/packages/website/ts/utils/constants.ts
+++ b/packages/website/ts/utils/constants.ts
@@ -4,6 +4,9 @@ import { BigNumber } from '@0xproject/utils';
export const constants = {
DECIMAL_PLACES_ETH: 18,
DECIMAL_PLACES_ZRX: 18,
+ ETHER_TOKEN_SYMBOL: 'WETH',
+ ZRX_TOKEN_SYMBOL: 'ZRX',
+ ETHER_SYMBOL: 'ETH',
GENESIS_ORDER_BLOCK_BY_NETWORK_ID: {
1: 4145578,
42: 3117574,
diff --git a/packages/website/ts/utils/style.ts b/packages/website/ts/utils/style.ts
index 51b6e4eb6..0411cdd91 100644
--- a/packages/website/ts/utils/style.ts
+++ b/packages/website/ts/utils/style.ts
@@ -1,4 +1,5 @@
export const zIndex = {
topBar: 1100,
- overlay: 1101,
+ overlay: 1105,
+ aboveOverlay: 1106,
};
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index e79a873e0..b9d962b75 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -11,6 +11,7 @@ import {
Environments,
Order,
Providers,
+ ProviderType,
ScreenWidths,
Side,
SideToAssetToken,
@@ -313,8 +314,16 @@ export const utils = {
isStaging(): boolean {
return _.includes(window.location.href, configs.DOMAIN_STAGING);
},
+ isExternallyInjected(providerType: ProviderType, injectedProviderName: string): boolean {
+ return providerType === ProviderType.Injected && injectedProviderName !== constants.PROVIDER_NAME_PUBLIC;
+ },
isDogfood,
shouldShowPortalV2(): boolean {
return this.isDevelopment() || this.isStaging() || this.isDogfood();
},
+ getEthToken(tokenByAddress: TokenByAddress): Token {
+ const tokens = _.values(tokenByAddress);
+ const etherToken = _.find(tokens, { symbol: constants.ETHER_TOKEN_SYMBOL });
+ return etherToken;
+ },
};