diff options
author | August Skare <post@augustskare.no> | 2018-11-16 18:28:24 +0800 |
---|---|---|
committer | August Skare <post@augustskare.no> | 2018-11-16 18:28:24 +0800 |
commit | c08108144825c33d8db26053c1d2d41460b09359 (patch) | |
tree | 6f21ce1e6834e0130b0f6063a097014cc1cc671f /packages/instant/src/components/install_wallet_panel_content.tsx | |
parent | 54bd7df900316504e4403bc94cffd92930a6c763 (diff) | |
parent | cabb7432b9a6d4a5bb8da6fc7fe4522d24e4ece5 (diff) | |
download | dexon-0x-contracts-c08108144825c33d8db26053c1d2d41460b09359.tar.gz dexon-0x-contracts-c08108144825c33d8db26053c1d2d41460b09359.tar.zst dexon-0x-contracts-c08108144825c33d8db26053c1d2d41460b09359.zip |
Merge branch 'development' into dev-tools-pages
Diffstat (limited to 'packages/instant/src/components/install_wallet_panel_content.tsx')
-rw-r--r-- | packages/instant/src/components/install_wallet_panel_content.tsx | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/packages/instant/src/components/install_wallet_panel_content.tsx b/packages/instant/src/components/install_wallet_panel_content.tsx new file mode 100644 index 000000000..88c26f59c --- /dev/null +++ b/packages/instant/src/components/install_wallet_panel_content.tsx @@ -0,0 +1,68 @@ +import * as React from 'react'; + +import { + META_MASK_CHROME_STORE_URL, + META_MASK_FIREFOX_STORE_URL, + META_MASK_OPERA_STORE_URL, + META_MASK_SITE_URL, +} from '../constants'; +import { ColorOption } from '../style/theme'; +import { Browser } from '../types'; +import { envUtil } from '../util/env'; + +import { MetaMaskLogo } from './meta_mask_logo'; +import { StandardPanelContent, StandardPanelContentProps } from './standard_panel_content'; +import { Button } from './ui/button'; + +export interface InstallWalletPanelContentProps {} + +export class InstallWalletPanelContent extends React.Component<InstallWalletPanelContentProps> { + public render(): React.ReactNode { + const panelProps = this._getStandardPanelContentProps(); + return <StandardPanelContent {...panelProps} />; + } + private readonly _getStandardPanelContentProps = (): StandardPanelContentProps => { + const browser = envUtil.getBrowser(); + let description = 'Please install the MetaMask wallet browser extension.'; + let actionText = 'Learn More'; + let actionUrl = META_MASK_SITE_URL; + switch (browser) { + case Browser.Chrome: + description = 'Please install the MetaMask wallet browser extension from the Chrome Store.'; + actionText = 'Get Chrome Extension'; + actionUrl = META_MASK_CHROME_STORE_URL; + break; + case Browser.Firefox: + description = 'Please install the MetaMask wallet browser extension from the Firefox Store.'; + actionText = 'Get Firefox Extension'; + actionUrl = META_MASK_FIREFOX_STORE_URL; + break; + case Browser.Opera: + description = 'Please install the MetaMask wallet browser extension from the Opera Store.'; + actionText = 'Get Opera Add-on'; + actionUrl = META_MASK_OPERA_STORE_URL; + break; + default: + break; + } + return { + image: <MetaMaskLogo width={85} height={80} />, + title: 'Install MetaMask', + description, + moreInfoSettings: { + href: META_MASK_SITE_URL, + text: 'What is MetaMask?', + }, + action: ( + <Button + href={actionUrl} + width="100%" + fontColor={ColorOption.white} + backgroundColor={ColorOption.darkOrange} + > + {actionText} + </Button> + ), + }; + }; +} |