aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-06-26 07:14:04 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-06-26 08:48:36 +0800
commite52d0a351265616d58d9126404db7a359a6648be (patch)
tree045faabeec5dc3fec9ee806e7bf6e8dee0add37a /packages/website/ts/utils
parentcba92a01b6dee208b497817445b7ae4048e299c0 (diff)
downloaddexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.tar
dexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.tar.gz
dexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.tar.bz2
dexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.tar.lz
dexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.tar.xz
dexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.tar.zst
dexon-sol-tools-e52d0a351265616d58d9126404db7a359a6648be.zip
Change metamask install link based on browser
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/constants.ts3
-rw-r--r--packages/website/ts/utils/utils.ts13
2 files changed, 16 insertions, 0 deletions
diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts
index 25670ef27..a3f8eacb0 100644
--- a/packages/website/ts/utils/constants.ts
+++ b/packages/website/ts/utils/constants.ts
@@ -70,6 +70,9 @@ export const constants = {
URL_GITHUB_ORG: 'https://github.com/0xProject',
URL_GITHUB_WIKI: 'https://github.com/0xProject/wiki',
URL_METAMASK_CHROME_STORE: 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn',
+ URL_METAMASK_FIREFOX_STORE: 'https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/',
+ URL_METAMASK_HOMEPAGE: 'https://metamask.io/',
+ URL_METAMASK_OPERA_STORE: 'https://addons.opera.com/en/extensions/details/metamask/',
URL_MIST_DOWNLOAD: 'https://github.com/ethereum/mist/releases',
URL_PARITY_CHROME_STORE:
'https://chrome.google.com/webstore/detail/parity-ethereum-integrati/himekenlppkgeaoeddcliojfddemadig',
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 0cb965f05..ff06d923d 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -4,11 +4,13 @@ import { constants as sharedConstants, Networks } from '@0xproject/react-shared'
import { ECSignature, Provider } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import * as bowser from 'bowser';
import deepEqual = require('deep-equal');
import * as _ from 'lodash';
import * as moment from 'moment';
import {
BlockchainCallErrs,
+ BrowserType,
Environments,
Order,
Providers,
@@ -368,4 +370,15 @@ export const utils = {
isMobile(screenWidth: ScreenWidths): boolean {
return screenWidth === ScreenWidths.Sm;
},
+ getBrowserType(): BrowserType {
+ if (bowser.chrome) {
+ return BrowserType.Chrome;
+ } else if (bowser.firefox) {
+ return BrowserType.Firefox;
+ } else if (bowser.opera) {
+ return BrowserType.Opera;
+ } else {
+ return BrowserType.Other;
+ }
+ },
};