-
-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn / Prevent Outdated Browsers from Wallet Generation (#329)
- Loading branch information
Showing
5 changed files
with
145 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
common/containers/Tabs/GenerateWallet/components/CryptoWarning.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@import "common/sass/variables"; | ||
|
||
.CryptoWarning { | ||
max-width: 740px; | ||
margin: 0 auto; | ||
text-align: center; | ||
|
||
&-title { | ||
margin-bottom: 15px; | ||
} | ||
|
||
&-text { | ||
margin-bottom: 30px; | ||
} | ||
|
||
&-browsers { | ||
&-browser { | ||
display: inline-block; | ||
width: 86px; | ||
margin: 0 25px; | ||
color: $text-color; | ||
opacity: 0.8; | ||
transition: opacity 100ms ease; | ||
|
||
&:hover { | ||
opacity: 1; | ||
} | ||
|
||
&-icon { | ||
width: 100%; | ||
height: auto; | ||
margin-bottom: 10px; | ||
} | ||
|
||
&-name { | ||
font-size: 18px; | ||
font-weight: 300; | ||
} | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
common/containers/Tabs/GenerateWallet/components/CryptoWarning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import * as React from 'react'; | ||
import NewTabLink from 'components/ui/NewTabLink'; | ||
import isMobile from 'utils/isMobile'; | ||
|
||
import firefoxIcon from 'assets/images/browsers/firefox.svg'; | ||
import chromeIcon from 'assets/images/browsers/chrome.svg'; | ||
import operaIcon from 'assets/images/browsers/opera.svg'; | ||
import './CryptoWarning.scss'; | ||
|
||
const BROWSERS = [{ | ||
name: "Firefox", | ||
href: "https://www.mozilla.org/en-US/firefox/new/", | ||
icon: firefoxIcon, | ||
}, { | ||
name: "Chrome", | ||
href: "https://www.google.com/chrome/browser/desktop/index.html", | ||
icon: chromeIcon, | ||
}, { | ||
name: "Opera", | ||
href: "http://www.opera.com/", | ||
icon: operaIcon, | ||
}]; | ||
|
||
const CryptoWarning: React.SFC<{}> = () => | ||
<div className="Tab-content-pane"> | ||
<div className="CryptoWarning"> | ||
<h2 className="CryptoWarning-title"> | ||
Your Browser Cannot Generate a Wallet | ||
</h2> | ||
<p className="CryptoWarning-text"> | ||
{isMobile ? ` | ||
MyEtherWallet requires certain features for secure wallet generation | ||
that your browser doesn't offer. You can still securely use the site | ||
otherwise. To generate a wallet, please use your device's default | ||
browser, or switch to a laptop or desktop computer. | ||
` : ` | ||
MyEtherWallet requires certain features for secure wallet generation | ||
that your browser doesn't offer. You can still securely use the site | ||
otherwise. To generate a wallet, upgrade to one of the following | ||
browsers: | ||
`} | ||
</p> | ||
|
||
<div className="CryptoWarning-browsers"> | ||
{BROWSERS.map((browser) => | ||
<NewTabLink | ||
key={browser.href} | ||
href={browser.href} | ||
className="CryptoWarning-browsers-browser" | ||
> | ||
<div> | ||
<img | ||
className="CryptoWarning-browsers-browser-icon" | ||
src={browser.icon} | ||
/> | ||
<div className="CryptoWarning-browsers-browser-name"> | ||
{browser.name} | ||
</div> | ||
</div> | ||
</NewTabLink> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
export default CryptoWarning; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const isMobile = window && window.navigator ? | ||
/iPhone|iPad|iPod|Android/i.test(window.navigator.userAgent) : false; | ||
|
||
export default isMobile; |