aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/wallet
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-04 05:28:49 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-04 05:28:49 +0800
commit931e7e7d71be4ec18081a2501dee0254b511f388 (patch)
tree05aea28a30ba1597e7f3437593fe57701ddd4640 /packages/website/ts/components/wallet
parent3b78188fec8654ff9338afb22708279bf2335c70 (diff)
downloaddexon-sol-tools-931e7e7d71be4ec18081a2501dee0254b511f388.tar.gz
dexon-sol-tools-931e7e7d71be4ec18081a2501dee0254b511f388.tar.zst
dexon-sol-tools-931e7e7d71be4ec18081a2501dee0254b511f388.zip
Prompt user to download Toshi or MetaMask in install wallet onboarding step
Diffstat (limited to 'packages/website/ts/components/wallet')
-rw-r--r--packages/website/ts/components/wallet/body_overlay.tsx35
1 files changed, 2 insertions, 33 deletions
diff --git a/packages/website/ts/components/wallet/body_overlay.tsx b/packages/website/ts/components/wallet/body_overlay.tsx
index 6995b5065..d8fdade7d 100644
--- a/packages/website/ts/components/wallet/body_overlay.tsx
+++ b/packages/website/ts/components/wallet/body_overlay.tsx
@@ -9,8 +9,7 @@ import { Text } from 'ts/components/ui/text';
import { Dispatcher } from 'ts/redux/dispatcher';
import { colors } from 'ts/style/colors';
import { styled } from 'ts/style/theme';
-import { AccountState, BrowserType, ProviderType, OperatingSystemType } from 'ts/types';
-import { constants } from 'ts/utils/constants';
+import { AccountState, ProviderType } from 'ts/types';
import { utils } from 'ts/utils/utils';
const METAMASK_IMG_SRC = '/images/metamask_icon.png';
@@ -116,39 +115,9 @@ const UseDifferentWallet = (props: UseDifferentWallet) => {
};
const GetWalletCallToAction = () => {
- const browserType = utils.getBrowserType();
- const isOnMobile = utils.isMobileOperatingSystem();
- const operatingSystem = utils.getOperatingSystem();
+ const [downloadLink, isOnMobile] = utils.getBestWalletDownloadLink();
const imageUrl = isOnMobile ? TOSHI_IMG_SRC : METAMASK_IMG_SRC;
const text = isOnMobile ? 'Get Toshi Wallet' : 'Get MetaMask Wallet';
- let downloadLink;
- if (isOnMobile) {
- switch (operatingSystem) {
- case OperatingSystemType.Android:
- downloadLink = constants.URL_TOSHI_ANDROID_APP_STORE;
- break;
- case OperatingSystemType.iOS:
- downloadLink = constants.URL_TOSHI_IOS_APP_STORE;
- break;
- default:
- // Toshi is only supported on these mobile OSes - just default to iOS
- downloadLink = constants.URL_TOSHI_IOS_APP_STORE;
- }
- } else {
- switch (browserType) {
- case BrowserType.Chrome:
- downloadLink = constants.URL_METAMASK_CHROME_STORE;
- break;
- case BrowserType.Firefox:
- downloadLink = constants.URL_METAMASK_FIREFOX_STORE;
- break;
- case BrowserType.Opera:
- downloadLink = constants.URL_METAMASK_OPERA_STORE;
- break;
- default:
- downloadLink = constants.URL_METAMASK_HOMEPAGE;
- }
- }
return (
<a href={downloadLink} target="_blank" style={{ textDecoration: 'none' }}>
<Island