diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-07-06 02:09:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 02:09:25 +0800 |
commit | e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a (patch) | |
tree | 077f051e45ffb23693c52973443cbf1713398650 /packages/website/ts/components/wallet | |
parent | 87a7a4ad2d55641cbe06d7157df0d8f0996d033a (diff) | |
parent | 302b9deef3a7625caa6d49ccc497936d5e4f07e2 (diff) | |
download | dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.tar dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.tar.gz dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.tar.bz2 dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.tar.lz dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.tar.xz dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.tar.zst dexon-sol-tools-e0f80c5e6aea48e83108d6c6cd481cdce26c9a4a.zip |
Merge pull request #816 from 0xProject/feature/website/portal-mobile-improvements
Make onboarding and wallet copy dynamic based on OS
Diffstat (limited to 'packages/website/ts/components/wallet')
-rw-r--r-- | packages/website/ts/components/wallet/body_overlay.tsx | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/packages/website/ts/components/wallet/body_overlay.tsx b/packages/website/ts/components/wallet/body_overlay.tsx index 5ced704f9..26359d0d2 100644 --- a/packages/website/ts/components/wallet/body_overlay.tsx +++ b/packages/website/ts/components/wallet/body_overlay.tsx @@ -9,11 +9,11 @@ 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 } 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'; +const TOSHI_IMG_SRC = '/images/toshi_logo.jpg'; export interface BodyOverlayProps { dispatcher: Dispatcher; @@ -92,8 +92,10 @@ interface DisconnectedOverlayProps { const DisconnectedOverlay = (props: DisconnectedOverlayProps) => { return ( <div className="flex flex-column items-center"> - <GetMetaMask /> - <UseDifferentWallet fontColor={colors.mediumBlue} onClick={props.onUseDifferentWalletClicked} /> + <GetWalletCallToAction /> + {!utils.isMobileOperatingSystem() && ( + <UseDifferentWallet fontColor={colors.mediumBlue} onClick={props.onUseDifferentWalletClicked} /> + )} </div> ); }; @@ -112,32 +114,20 @@ const UseDifferentWallet = (props: UseDifferentWallet) => { ); }; -const GetMetaMask = () => { - const browserType = utils.getBrowserType(); - let extensionLink; - switch (browserType) { - case BrowserType.Chrome: - extensionLink = constants.URL_METAMASK_CHROME_STORE; - break; - case BrowserType.Firefox: - extensionLink = constants.URL_METAMASK_FIREFOX_STORE; - break; - case BrowserType.Opera: - extensionLink = constants.URL_METAMASK_OPERA_STORE; - break; - default: - extensionLink = constants.URL_METAMASK_HOMEPAGE; - } +const GetWalletCallToAction = () => { + const [downloadLink, isOnMobile] = utils.getBestWalletDownloadLinkAndIsMobile(); + const imageUrl = isOnMobile ? TOSHI_IMG_SRC : METAMASK_IMG_SRC; + const text = isOnMobile ? 'Get Toshi Wallet' : 'Get MetaMask Wallet'; return ( - <a href={extensionLink} target="_blank" style={{ textDecoration: 'none' }}> + <a href={downloadLink} target="_blank" style={{ textDecoration: 'none' }}> <Island className="flex items-center py1 px2" style={{ height: 28, borderRadius: 28, backgroundColor: colors.mediumBlue }} > - <Image src={METAMASK_IMG_SRC} width="28px" /> + <Image src={imageUrl} width="28px" borderRadius="22%" /> <Container marginLeft="8px" marginRight="12px"> <Text fontColor={colors.white} fontSize="16px" fontWeight={500}> - Get MetaMask Wallet + {text} </Text> </Container> </Island> |