From a430fe650cc9f2250f71261b455e811e6df791bc Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Tue, 27 Feb 2018 16:35:32 -0500 Subject: [PATCH 01/52] Update copy / links for Beta (#1193) * AlphaAgreement -> BetaAgreement. * Banner color. * Remove language disclaimer. * Discord link in footer. * Update font for discord icon. * Adjust copy. * Link to github repo in error message. * Remove always error --- common/assets/fonts/social-media.woff | Bin 1980 -> 1956 bytes common/assets/fonts/social-media.woff2 | Bin 1536 -> 1496 bytes common/components/AlphaAgreement/index.tsx | 66 ---------------- .../index.scss | 21 +++-- common/components/BetaAgreement/index.tsx | 72 ++++++++++++++++++ common/components/ErrorScreen/index.tsx | 12 ++- common/components/Footer/index.scss | 4 +- common/components/Footer/index.tsx | 7 +- common/components/Header/index.scss | 2 +- common/components/Header/index.tsx | 7 -- common/components/index.ts | 2 +- common/config/data.tsx | 23 +++--- common/containers/TabSection/index.tsx | 4 +- common/sass/fonts.scss | 14 ++-- 14 files changed, 122 insertions(+), 112 deletions(-) delete mode 100644 common/components/AlphaAgreement/index.tsx rename common/components/{AlphaAgreement => BetaAgreement}/index.scss (79%) create mode 100644 common/components/BetaAgreement/index.tsx diff --git a/common/assets/fonts/social-media.woff b/common/assets/fonts/social-media.woff index d4d0e518360e7fb682727a1ce5a6278d98966036..7a4155b92a16367672fd6d3a29e27be5e6a0d893 100644 GIT binary patch delta 1815 zcmXw32T;>@6#gf~BoGt~AW&<<2uo-HWho#VK`47;lrWTti6CHDB|%1mAREdEVia45 z>{S6}1V}{%w16y8ur!2Glp%ZcPw)EfzI*R|zwh3A_q%)Vxk#yqIMv?L5`X}pAxZ(% zp+_ZTiW|{*eq>@W06^#Hi#Mu2^F zj%N=J-wF)_r#1#PU=iS6&-Z4}vXKxHP0HkQ zh$TZK9}2V=BddT2=0BO8N9h{E0@Yd#NKGMMnJWhQZ8pYC4R~gMR;98CB0p|^G0mh| zInd7DW+qqr_Fs%s&KL4#LyAk6eh6D3tft&wYFZvR5k;$dT8leh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Uq;Hx^g!P zyi47~IZU&H4#1;cCgVOl@Jh?cUsNR*jJC?iX-es@gFXCj3)=nbx04fI%^EHlM*N8O z;d0++eVup{Ql<;m6^jKHmZq2GcTUwDh3a+STwLSpvl#LagK^I2>FVv``a(pbBlTb^ zf}9)Bf%&%vkYMFIW^6HVAW8DDQ71T0ZmzB)G-edy!Wng5eSx`z7rX7upHJhxB7Z8_{ z>LAMqjP842zjh67ir%PdC>|*=UXb-y2wGGo!7oQs4d>)Y?3i9r`TWV$18`aoSO zD&BQBO6XM?8qbRIUpIh%O|)ew)|8a3_jf2w-mu2Rwd;i;r!J`~I_D2|q31yEvG=wV zwNE2nmL7LkPE$t%U(v4Sq77n(CiXKek9fFO%G)>$vsHP*KE#ZPJ7u9=CW_H}kDmv2 z;ysPQw=WY`C4IuJ6XeL#ADhEEkTPd*p?jYG(62p6`i&<7#b?dzF+E;*B+J)(! diff --git a/common/assets/fonts/social-media.woff2 b/common/assets/fonts/social-media.woff2 index f2acafc8912888bfecb7463cdafbe37a5684d8b0..78e4b3ef580b75b47252949fef1af344f934e18f 100644 GIT binary patch delta 1486 zcmV;<1u^=74A=`8cTYw#00961000Hp01E&B000Yw000Gvkr*C-L<))!h!p`g0we<< z3labXAO(a92Z0J3unAF=PEMBW=YYGptkv>-i^B`gVYQ)AP*TQ4W@gUhCxT?zX0LQ= zajgqYh(}dbSp@~zw=FhS|_a!4=f)!Nc|kByUll-gVFv6F#Nqu|0KNIb}nPSd27zXz!HtZ zv4|5F4S=MGF4fLmB}gW%>B5oFn%=V= zlekQXKqST_Dhj3+pIcg)&#|~pkhzSxxIWAzdA+zDzzT~_V83<<;w+7+T&D_Yj|O!z zZB)9nO99L`VqK&lrfxx+u%#@ul#WDK-!GIg<6LQfS_acL0fmYLD4P%O*AE`uDhE05 z(2~AI+)hYntUVEeP?LHIh!h7-T~4P7{mxAZKnOr}D~&)hgOd;#X+B0m8xxHn+kpC9 zN8E5FiztglO&WMGOpqqg&3Kc2uESWbx;1|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P&z}U1P~o { - public state = { - hasAcknowledged: !!localStorage.getItem(LS_KEY), - isFading: false - }; - - public render() { - if (this.state.hasAcknowledged) { - return null; - } - - const isFading = this.state.isFading ? 'is-fading' : ''; - - return ( -
-
-

This is an Unstable Version of MyCrypto

-

- You are about to access a beta version of MyCrypto that is currently in development. In - its current state, it should only be used for testing, not for important transactions. -

-

- Any wallets you generate should not hold a significant value, and any transactions you - make should be for small amounts. MyCrypto does not claim responsibility for any issues - that happen while using the beta version. -

-

Are you sure you would like to continue?

- -
- - -
-
-
- ); - } - - private doContinue = () => { - localStorage.setItem(LS_KEY, 'true'); - this.setState({ isFading: true }); - - setTimeout(() => { - this.setState({ hasAcknowledged: true }); - }, 1000); - }; - - private reject = () => { - window.location.assign('https://mycrypto.com'); - }; -} diff --git a/common/components/AlphaAgreement/index.scss b/common/components/BetaAgreement/index.scss similarity index 79% rename from common/components/AlphaAgreement/index.scss rename to common/components/BetaAgreement/index.scss index 18665d51..f8171e20 100644 --- a/common/components/AlphaAgreement/index.scss +++ b/common/components/BetaAgreement/index.scss @@ -1,43 +1,50 @@ @import "common/sass/variables"; @import "common/sass/mixins"; -.AlphaAgreement { +.BetaAgreement { @include cover-message; background: $brand-info; &-content { + h2 { + text-align: center; + } + &-buttons { padding-top: 20px; &-btn { display: block; width: 100%; - max-width: 240px; + max-width: 280px; margin: 0 auto; border: none; padding: 0; outline: none; + transition: $transition; - &.is-reject { + &.is-continue { height: 60px; line-height: 60px; font-size: 22px; background: rgba(#fff, 0.96); - color: $gray; + color: $gray-dark; border-radius: 4px; margin-bottom: 20px; &:hover { background: #fff; + color: $gray-darker; } } - &.is-continue { + &.is-reject { background: none; color: #fff; + opacity: 0.7; &:hover { - text-decoration: underline; + opacity: 1; } } } @@ -51,7 +58,7 @@ background: #fff; transition: all 500ms ease 400ms; - .AlphaAgreement-content { + .BetaAgreement-content { opacity: 0; transform: translateY(15px); transition: all 500ms ease; diff --git a/common/components/BetaAgreement/index.tsx b/common/components/BetaAgreement/index.tsx new file mode 100644 index 00000000..fa97718f --- /dev/null +++ b/common/components/BetaAgreement/index.tsx @@ -0,0 +1,72 @@ +import React from 'react'; +import { NewTabLink } from 'components/ui'; +import { discordURL } from 'config'; +import './index.scss'; + +const LS_KEY = 'acknowledged-beta'; + +interface State { + isFading: boolean; + hasAcknowledged: boolean; +} +export default class BetaAgreement extends React.PureComponent<{}, State> { + public state = { + hasAcknowledged: !!localStorage.getItem(LS_KEY), + isFading: false + }; + + public render() { + if (this.state.hasAcknowledged) { + return null; + } + + const isFading = this.state.isFading ? 'is-fading' : ''; + + return ( +
+
+

Welcome to the New MyCrypto Beta!

+

+ You are about to use a version of MyCrypto that hasn't been released yet. While we are + confident that it is close to being production ready, you may want to use the current + production site for larger or more time-sensitive transactions. +

+

+ Feedback and bug reports are greatly appreciated. You can file issues on our{' '} + + GitHub repository + {' '} + or join our Discord server to discuss the + beta. +

+

Are you sure you would like to continue?

+ +
+ + +
+
+
+ ); + } + + private doContinue = () => { + localStorage.setItem(LS_KEY, 'true'); + this.setState({ isFading: true }); + + setTimeout(() => { + this.setState({ hasAcknowledged: true }); + }, 1000); + }; + + private reject = () => { + window.location.assign('https://mycrypto.com'); + }; +} diff --git a/common/components/ErrorScreen/index.tsx b/common/components/ErrorScreen/index.tsx index 6c1b3063..76953117 100644 --- a/common/components/ErrorScreen/index.tsx +++ b/common/components/ErrorScreen/index.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { NewTabLink } from 'components/ui'; import './index.scss'; const SUBJECT = 'Error!'; @@ -24,14 +25,17 @@ const ErrorScreen: React.SFC = ({ error }) => { > support@mycrypto.com {' '} - if a refresh doesn't fix it (or click it anyway to open a ticket 😊). If you attach the - following error, you'll make it a ton easier to fix the issue. + if a refresh doesn't fix it (or click it anyway to open a ticket 😊). You can also submit + an issue on our{' '} + + GitHub Repository + . Please attach the following error to help our team solve your issue.

+ {error.message}
Please make sure the error message does not include any sensitive information before - sending it us. We don't want your private keys! + sending it to us. We don't want your private keys!
- {error.message} ); diff --git a/common/components/Footer/index.scss b/common/components/Footer/index.scss index cf7ac9d5..23a39852 100644 --- a/common/components/Footer/index.scss +++ b/common/components/Footer/index.scss @@ -158,10 +158,10 @@ $footer-link-color: #fff; .SocialMediaLink { transition: opacity 0.3s; color: #fff; - margin: 0.65rem; + margin: 0.55rem; > i { - font-size: 1.2rem; + font-size: 1.15rem; } &:hover, diff --git a/common/components/Footer/index.tsx b/common/components/Footer/index.tsx index 46e2e9f1..15bf7e38 100644 --- a/common/components/Footer/index.tsx +++ b/common/components/Footer/index.tsx @@ -5,7 +5,8 @@ import { ethercardReferralURL, donationAddressMap, VERSION, - knowledgeBaseURL + knowledgeBaseURL, + discordURL } from 'config'; import React from 'react'; import PreFooter from './PreFooter'; @@ -46,6 +47,10 @@ const SOCIAL_MEDIA: Link[] = [ { link: 'https://www.reddit.com/r/mycrypto/', text: 'reddit' + }, + { + link: discordURL, + text: 'discord' } ]; diff --git a/common/components/Header/index.scss b/common/components/Header/index.scss index 24af876a..8b93a087 100644 --- a/common/components/Header/index.scss +++ b/common/components/Header/index.scss @@ -41,6 +41,7 @@ $small-size: 900px; font-weight: 300; color: #fff; transition: background-color 80ms ease; + background: $gray-darker; a { color: #fff; @@ -54,7 +55,6 @@ $small-size: 900px; } // Colors - &, &.is-primary { background: $brand-primary; } diff --git a/common/components/Header/index.tsx b/common/components/Header/index.tsx index d0884ce3..a0ab67b2 100644 --- a/common/components/Header/index.tsx +++ b/common/components/Header/index.tsx @@ -155,13 +155,6 @@ class Header extends Component { ariaLabel={`change language. current language ${languages[selectedLanguage]}`} options={Object.values(languages)} value={languages[selectedLanguage]} - extra={ -
  • - - Disclaimer - -
  • - } onChange={this.changeLanguage} size="smr" color="white" diff --git a/common/components/index.ts b/common/components/index.ts index 6492d461..421927e5 100644 --- a/common/components/index.ts +++ b/common/components/index.ts @@ -13,7 +13,7 @@ export { default as Header } from './Header'; export { default as Footer } from './Footer'; export { default as BalanceSidebar } from './BalanceSidebar'; export { default as PaperWallet } from './PaperWallet'; -export { default as AlphaAgreement } from './AlphaAgreement'; +export { default as BetaAgreement } from './BetaAgreement'; export { default as TXMetaDataPanel } from './TXMetaDataPanel'; export { default as WalletDecrypt } from './WalletDecrypt'; export { default as TogglablePassword } from './TogglablePassword'; diff --git a/common/config/data.tsx b/common/config/data.tsx index 1c0ed729..6bce4436 100644 --- a/common/config/data.tsx +++ b/common/config/data.tsx @@ -1,31 +1,26 @@ import React from 'react'; // For ANNOUNCEMENT_MESSAGE jsx +import NewTabLink from 'components/ui/NewTabLink'; import { getValues } from '../utils/helpers'; import packageJson from '../../package.json'; import { GasPriceSetting } from 'types/network'; export const languages = require('./languages.json'); +export const discordURL = 'https://discord.gg/VSaTXEA'; // Displays in the footer export const VERSION = `${packageJson.version} (BETA)`; export const N_FACTOR = 8192; // Displays at the top of the site, make message empty string to remove. -// Type can be primary, warning, danger, success, or info. +// Type can be primary, warning, danger, success, info, or blank for grey. // Message must be a JSX element if you want to use HTML. -export const ANNOUNCEMENT_TYPE = 'warning'; +export const ANNOUNCEMENT_TYPE = ''; export const ANNOUNCEMENT_MESSAGE = ( -
    - This is an early build of MyCrypto Beta. Please only use for testing, or use production at{' '} - {'https://mycrypto.com'}. -
    - - If you're interested in recieving updates about the MyCrypto Beta, you can subscribe via{' '} - - mailchimp - {' '} - :) - -
    + + This is a Beta version of MyCrypto. Please submit any bug reports to our{' '} + GitHub, and join + the discussion on Discord. + ); const etherScan = 'https://etherscan.io'; diff --git a/common/containers/TabSection/index.tsx b/common/containers/TabSection/index.tsx index cf2eed47..198778dd 100644 --- a/common/containers/TabSection/index.tsx +++ b/common/containers/TabSection/index.tsx @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; -import { AlphaAgreement, Footer, Header } from 'components'; +import { BetaAgreement, Footer, Header } from 'components'; import { AppState } from 'reducers'; import Notifications from './Notifications'; import OfflineTab from './OfflineTab'; @@ -31,7 +31,7 @@ class TabSection extends Component {
    - +
    ); } diff --git a/common/sass/fonts.scss b/common/sass/fonts.scss index bb1877f2..a98b616c 100644 --- a/common/sass/fonts.scss +++ b/common/sass/fonts.scss @@ -65,25 +65,25 @@ font-size: 48px; } // Refer to docs for updating icon-fonts - &.sm-logo-facebook:before { + &.sm-logo-medium:before { content: '\ea02'; } - &.sm-logo-reddit:before { + &.sm-logo-discord:before { content: '\ea03'; } - &.sm-logo-github:before { + &.sm-logo-linkedin:before { content: '\ea04'; } - &.sm-logo-twitter:before { + &.sm-logo-reddit:before { content: '\ea05'; } - &.sm-logo-linkedin:before { + &.sm-logo-facebook:before { content: '\ea06'; } - &.sm-logo-slack:before { + &.sm-logo-twitter:before { content: '\ea07'; } - &.sm-logo-medium:before { + &.sm-logo-github:before { content: '\ea08'; } } From 375360e71ad560a371f318ef20597d14f33fb861 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 10:34:42 -0600 Subject: [PATCH 02/52] chore(package): update cache-loader to version 1.2.2 (#1196) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c67a4e31..81bdab76 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "awesome-typescript-loader": "3.5.0", "babel-minify-webpack-plugin": "0.3.0", "bs58": "4.0.1", - "cache-loader": "1.2.1", + "cache-loader": "1.2.2", "check-node-version": "3.2.0", "concurrently": "3.5.1", "copy-webpack-plugin": "4.4.2", From e5b2ccef7a78c66e7ea4177522e86458b53d8782 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 19:35:09 -0600 Subject: [PATCH 03/52] chore(package): update @types/react to version 16.0.39 (#1208) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81bdab76..a2d9ffaf 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@types/qrcode": "0.8.0", "@types/qrcode.react": "0.6.3", "@types/query-string": "5.1.0", - "@types/react": "16.0.38", + "@types/react": "16.0.39", "@types/react-dom": "16.0.4", "@types/react-redux": "5.0.15", "@types/react-router-dom": "4.2.4", From 070b07ae409b5a48e899c37ce0f0f129f862dac4 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 28 Feb 2018 20:16:12 -0600 Subject: [PATCH 04/52] chore(package): update nodemon to version 1.17.1 (#1195) Closes #1190 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2d9ffaf..c59d42c1 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "lint-staged": "6.1.1", "minimist": "1.2.0", "node-sass": "4.7.2", - "nodemon": "1.15.1", + "nodemon": "1.17.1", "null-loader": "0.1.1", "prettier": "1.10.2", "progress": "2.0.0", From 093b0fecf62159d2a4a585d3807d61a575c33fbb Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 20:19:53 -0600 Subject: [PATCH 05/52] chore(package): update less-loader to version 4.0.6 (#1187) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c59d42c1..69161ecb 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "jest": "22.1.4", "klaw-sync": "3.0.2", "less": "2.7.3", - "less-loader": "4.0.5", + "less-loader": "4.0.6", "lint-staged": "6.1.1", "minimist": "1.2.0", "node-sass": "4.7.2", From c6f58bb19cc90147b6b90fdcf8bed79b977a86b4 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 20:26:17 -0600 Subject: [PATCH 06/52] fix(package): update rc-slider to version 8.6.1 (#1188) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 69161ecb..fb2917c0 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "qrcode": "1.2.0", "qrcode.react": "0.8.0", "query-string": "5.1.0", - "rc-slider": "8.6.0", + "rc-slider": "8.6.1", "react": "16.2.0", "react-copy-to-clipboard": "5.0.1", "react-dom": "16.2.0", From a9b07cdf18ae345b5866e1e5b2c2b553d19d1e80 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 20:26:44 -0600 Subject: [PATCH 07/52] chore(package): update @types/jest to version 22.1.4 (#1202) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb2917c0..bd6ea800 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "devDependencies": { "@types/classnames": "2.2.3", "@types/history": "4.6.2", - "@types/jest": "22.1.3", + "@types/jest": "22.1.4", "@types/lodash": "4.14.104", "@types/qrcode": "0.8.0", "@types/qrcode.react": "0.6.3", From 5fcec1ecd75f05ac5ff096f74236ee61163d52d7 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 28 Feb 2018 20:36:09 -0600 Subject: [PATCH 08/52] chore(package): update prettier to version 1.11.1 (#1209) Closes #1186 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bd6ea800..2c755a4a 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "node-sass": "4.7.2", "nodemon": "1.17.1", "null-loader": "0.1.1", - "prettier": "1.10.2", + "prettier": "1.11.1", "progress": "2.0.0", "react-hot-loader": "3.1.3", "react-test-renderer": "16.2.0", From 1eb57a38bcb6874997ec72f49c5a939a85ae76de Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Wed, 28 Feb 2018 21:54:43 -0500 Subject: [PATCH 09/52] Address component for checksumming + linking to explorer (#1168) * Add address component that checksums and optionally links to block explorer. * tscheck * Add exclusive props, type guard. --- .../components/BalanceSidebar/AccountInfo.tsx | 22 ++++------ common/components/CurrentCustomMessage.tsx | 6 ++- .../TransactionDataTable.tsx | 10 +++-- common/components/ui/Address.tsx | 40 +++++++++++++++++++ common/components/ui/index.ts | 1 + .../NameResolve/components/NameOwned.tsx | 10 +++-- .../components/Keystore/EnterPassword.scss | 1 + .../SendTransaction/components/WalletInfo.tsx | 11 ++--- shared/types/network.d.ts | 2 +- 9 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 common/components/ui/Address.tsx diff --git a/common/components/BalanceSidebar/AccountInfo.tsx b/common/components/BalanceSidebar/AccountInfo.tsx index 9080c541..325e17fd 100644 --- a/common/components/BalanceSidebar/AccountInfo.tsx +++ b/common/components/BalanceSidebar/AccountInfo.tsx @@ -1,4 +1,4 @@ -import { Identicon, UnitDisplay } from 'components/ui'; +import { Identicon, UnitDisplay, Address, NewTabLink } from 'components/ui'; import { IWallet, Balance, TrezorWallet, LedgerWallet } from 'libs/wallet'; import React from 'react'; import translate from 'translations'; @@ -103,7 +103,9 @@ class AccountInfo extends React.Component {
    -
    {address}
    +
    +
    +
    { diff --git a/common/components/CurrentCustomMessage.tsx b/common/components/CurrentCustomMessage.tsx index 6932955c..016c90e1 100644 --- a/common/components/CurrentCustomMessage.tsx +++ b/common/components/CurrentCustomMessage.tsx @@ -5,6 +5,7 @@ import { getCurrentTo, ICurrentTo } from 'selectors/transaction'; import { getAllTokens } from 'selectors/config'; import { getWalletInst } from 'selectors/wallet'; import { getAddressMessage } from 'config'; +import { Address } from 'components/ui'; import { Token } from 'types/network'; interface ReduxProps { @@ -72,7 +73,10 @@ class CurrentCustomMessageClass extends PureComponent {

    - A message regarding {address}: + A message regarding{' '} + +

    + :

    {msg.msg}

    diff --git a/common/components/TransactionStatus/TransactionDataTable.tsx b/common/components/TransactionStatus/TransactionDataTable.tsx index 4e5d2a6c..5ced532e 100644 --- a/common/components/TransactionStatus/TransactionDataTable.tsx +++ b/common/components/TransactionStatus/TransactionDataTable.tsx @@ -1,6 +1,6 @@ import React from 'react'; import translate from 'translations'; -import { Identicon, UnitDisplay, NewTabLink } from 'components/ui'; +import { Identicon, UnitDisplay, NewTabLink, Address } from 'components/ui'; import { TransactionData, TransactionReceipt } from 'libs/nodes'; import { NetworkConfig } from 'types/network'; import './TransactionDataTable.scss'; @@ -98,7 +98,7 @@ const TransactionDataTable: React.SFC = ({ data, receipt, network }) => { data: ( - {data.from} +
    ) }, @@ -107,7 +107,7 @@ const TransactionDataTable: React.SFC = ({ data, receipt, network }) => { data: ( - {data.to} +
    ) }, @@ -141,7 +141,9 @@ const TransactionDataTable: React.SFC = ({ data, receipt, network }) => { label: translate('New contract address'), data: receipt && receipt.contractAddress && ( - {receipt.contractAddress} + +
    + ) }, { diff --git a/common/components/ui/Address.tsx b/common/components/ui/Address.tsx new file mode 100644 index 00000000..209c8452 --- /dev/null +++ b/common/components/ui/Address.tsx @@ -0,0 +1,40 @@ +import React from 'react'; +import { toChecksumAddress } from 'ethereumjs-util'; +import NewTabLink from './NewTabLink'; +import { IWallet } from 'libs/wallet'; +import { BlockExplorerConfig } from 'types/network'; + +interface BaseProps { + explorer?: BlockExplorerConfig | null; +} + +interface AddressProps extends BaseProps { + address: string; +} + +interface WalletProps extends BaseProps { + wallet: IWallet; +} + +type Props = AddressProps | WalletProps; + +const isAddressProps = (props: Props): props is AddressProps => + typeof (props as AddressProps).address === 'string'; + +const Address: React.SFC = props => { + let addr = ''; + if (isAddressProps(props)) { + addr = props.address; + } else { + addr = props.wallet.getAddressString(); + } + addr = toChecksumAddress(addr); + + if (props.explorer) { + return {addr}; + } else { + return {addr}; + } +}; + +export default Address; diff --git a/common/components/ui/index.ts b/common/components/ui/index.ts index 6f979a2c..256c5d31 100644 --- a/common/components/ui/index.ts +++ b/common/components/ui/index.ts @@ -12,6 +12,7 @@ export { default as SwapDropdown } from './SwapDropdown'; export { default as Tooltip } from './Tooltip'; export { default as TitleBar } from './TitleBar'; export { default as HelpLink } from './HelpLink'; +export { default as Address } from './Address'; export * from './ConditionalInput'; export * from './Expandable'; export * from './InlineSpinner'; diff --git a/common/containers/Tabs/ENS/components/NameResolve/components/NameOwned.tsx b/common/containers/Tabs/ENS/components/NameResolve/components/NameOwned.tsx index 3140be60..19e698a7 100644 --- a/common/containers/Tabs/ENS/components/NameResolve/components/NameOwned.tsx +++ b/common/containers/Tabs/ENS/components/NameResolve/components/NameOwned.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { IOwnedDomainRequest } from 'libs/ens'; -import { NewTabLink } from 'components/ui'; +import { NewTabLink, Address } from 'components/ui'; const lookupLink = name => `https://etherscan.io/enslookup?q=${name}`; type ChildrenProps = any; @@ -40,7 +40,9 @@ export const NameOwned: React.SFC = ({ Owner: - {ownerAddress} + +
    + Highest Bidder (Deed Owner): @@ -50,7 +52,9 @@ export const NameOwned: React.SFC = ({ Resolved Address: - {resolvedAddress} + +
    + diff --git a/common/containers/Tabs/GenerateWallet/components/Keystore/EnterPassword.scss b/common/containers/Tabs/GenerateWallet/components/Keystore/EnterPassword.scss index 612b8d50..9cff932d 100644 --- a/common/containers/Tabs/GenerateWallet/components/Keystore/EnterPassword.scss +++ b/common/containers/Tabs/GenerateWallet/components/Keystore/EnterPassword.scss @@ -8,6 +8,7 @@ $pw-max-width: 40rem; } &-password { + display: block; position: relative; max-width: $pw-max-width; width: 100%; diff --git a/common/containers/Tabs/SendTransaction/components/WalletInfo.tsx b/common/containers/Tabs/SendTransaction/components/WalletInfo.tsx index 1c0241ef..6f9eba4f 100644 --- a/common/containers/Tabs/SendTransaction/components/WalletInfo.tsx +++ b/common/containers/Tabs/SendTransaction/components/WalletInfo.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { toChecksumAddress } from 'ethereumjs-util'; import translate, { translateRaw } from 'translations'; import { IWallet } from 'libs/wallet'; import { print } from 'components/PrintableWallet'; @@ -26,12 +27,12 @@ export default class WalletInfo extends React.PureComponent { }; public componentDidMount() { - this.setWalletAsyncState(this.props.wallet); + this.setStateFromWallet(this.props.wallet); } public componentWillReceiveProps(nextProps: Props) { if (this.props.wallet !== nextProps.wallet) { - this.setWalletAsyncState(nextProps.wallet); + this.setStateFromWallet(nextProps.wallet); } } @@ -114,9 +115,9 @@ export default class WalletInfo extends React.PureComponent { ); } - private async setWalletAsyncState(wallet: IWallet) { - const address = wallet.getAddressString(); - const privateKey = wallet.getPrivateKeyString ? await wallet.getPrivateKeyString() : ''; + private setStateFromWallet(wallet: IWallet) { + const address = toChecksumAddress(wallet.getAddressString()); + const privateKey = wallet.getPrivateKeyString ? wallet.getPrivateKeyString() : ''; this.setState({ address, privateKey }); } diff --git a/shared/types/network.d.ts b/shared/types/network.d.ts index cba0ced9..9332818e 100644 --- a/shared/types/network.d.ts +++ b/shared/types/network.d.ts @@ -2,7 +2,7 @@ import { StaticNetworksState, CustomNetworksState } from 'reducers/config/networ type StaticNetworkIds = 'ETH' | 'Ropsten' | 'Kovan' | 'Rinkeby' | 'ETC' | 'UBQ' | 'EXP'; -interface BlockExplorerConfig { +export interface BlockExplorerConfig { name: string; origin: string; txUrl(txHash: string): string; From bc2c4b776f108ff0e3717f79a19262271e3af495 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 21:01:21 -0600 Subject: [PATCH 10/52] chore(package): update css-loader to version 0.28.10 (#1163) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c755a4a..87592cde 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "check-node-version": "3.2.0", "concurrently": "3.5.1", "copy-webpack-plugin": "4.4.2", - "css-loader": "0.28.9", + "css-loader": "0.28.10", "electron": "1.8.2", "electron-builder": "20.2.0", "empty": "0.10.1", From d147ec1b151f0b194d173d6c51cd4a19b65aabb1 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 21:03:10 -0600 Subject: [PATCH 11/52] fix(package): update ethereumjs-util to version 5.1.5 (#1179) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 87592cde..55672519 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "ethereum-blockies": "git+https://github.com/MyCryptoHQ/blockies.git", "ethereumjs-abi": "0.6.5", "ethereumjs-tx": "1.3.3", - "ethereumjs-util": "5.1.4", + "ethereumjs-util": "5.1.5", "ethereumjs-wallet": "0.6.0", "font-awesome": "4.7.0", "hard-source-webpack-plugin": "0.5.16", From f12d72a57ecd8f53cd53f9fdb563e9880e2bd1bf Mon Sep 17 00:00:00 2001 From: Rajiv Shah Date: Wed, 28 Feb 2018 22:04:58 -0500 Subject: [PATCH 12/52] Fix typo in disclaimer modal (#1118) --- common/translations/lang/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/translations/lang/en.json b/common/translations/lang/en.json index 98bc483a..2f1fb36b 100644 --- a/common/translations/lang/en.json +++ b/common/translations/lang/en.json @@ -596,7 +596,7 @@ "ONBOARD_interface_title__alt": "MyCrypto is an Interface", "ONBOARD_why_title": "Why are you making me read all this?", "ONBOARD_why_content__1": "Because we need you to understand that we **cannot**...", - "ONBOARD_why_content__2": "Access your account or send your funds for you X.", + "ONBOARD_why_content__2": "Access your account or send your funds for you.", "ONBOARD_why_content__3": "Recover or change your private key.", "ONBOARD_why_content__4": "Recover or reset your password.", "ONBOARD_why_content__5": "Reverse, cancel, or refund transactions.", From c01a4beaaa7e93532684fc14ee20c57e4167c321 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 28 Feb 2018 21:13:15 -0600 Subject: [PATCH 13/52] chore(package): update thread-loader to version 1.1.5 (#1210) Closes #1159 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55672519..e1d3de1c 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "rimraf": "2.6.2", "sass-loader": "6.0.6", "style-loader": "0.20.2", - "thread-loader": "1.1.2", + "thread-loader": "1.1.5", "ts-jest": "22.4.0", "ts-loader": "3.3.1", "tslint": "5.9.1", From 1a711b5c20ba99c37bba9da1e5d8ae9c122684c6 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 28 Feb 2018 21:31:46 -0600 Subject: [PATCH 14/52] chore(package): update lint-staged to version 7.0.0 (#1156) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e1d3de1c..8014896f 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "klaw-sync": "3.0.2", "less": "2.7.3", "less-loader": "4.0.6", - "lint-staged": "6.1.1", + "lint-staged": "7.0.0", "minimist": "1.2.0", "node-sass": "4.7.2", "nodemon": "1.17.1", From 23546a1cf9b6a095cd306c6a4a50295663b2c18f Mon Sep 17 00:00:00 2001 From: Danny Skubak Date: Wed, 28 Feb 2018 23:31:33 -0500 Subject: [PATCH 15/52] Force Node Change on Web3 Unset (#1207) * add CONFIG_NODE_CHANGE_FORCE action * implement forceful node change on web3 * update comment * add test * make tsc happy * update test --- common/actions/config/actionCreators.ts | 8 +++++ common/actions/config/actionTypes.ts | 5 +++ common/actions/config/constants.ts | 1 + common/sagas/config/node.ts | 23 ++++++++++++ common/sagas/config/web3.ts | 10 +++--- spec/reducers/config/config.spec.ts | 16 ++++++--- spec/sagas/config/node.spec.ts | 48 +++++++++++++++++++++++++ 7 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 spec/sagas/config/node.spec.ts diff --git a/common/actions/config/actionCreators.ts b/common/actions/config/actionCreators.ts index 0c298680..1a2e770f 100644 --- a/common/actions/config/actionCreators.ts +++ b/common/actions/config/actionCreators.ts @@ -48,6 +48,14 @@ export function changeNodeIntent(payload: string): interfaces.ChangeNodeIntentAc }; } +export type TChangeNodeForce = typeof changeNodeForce; +export function changeNodeForce(payload: string): interfaces.ChangeNodeForceAction { + return { + type: TypeKeys.CONFIG_NODE_CHANGE_FORCE, + payload + }; +} + export type TAddCustomNode = typeof addCustomNode; export function addCustomNode( payload: interfaces.AddCustomNodeAction['payload'] diff --git a/common/actions/config/actionTypes.ts b/common/actions/config/actionTypes.ts index 8758af67..14b875aa 100644 --- a/common/actions/config/actionTypes.ts +++ b/common/actions/config/actionTypes.ts @@ -36,6 +36,11 @@ export interface ChangeNodeIntentAction { type: TypeKeys.CONFIG_NODE_CHANGE_INTENT; payload: string; } +/*** Force Change Node ***/ +export interface ChangeNodeForceAction { + type: TypeKeys.CONFIG_NODE_CHANGE_FORCE; + payload: string; +} /*** Add Custom Node ***/ export interface AddCustomNodeAction { diff --git a/common/actions/config/constants.ts b/common/actions/config/constants.ts index a3b58ac1..5c5265d3 100644 --- a/common/actions/config/constants.ts +++ b/common/actions/config/constants.ts @@ -10,6 +10,7 @@ export enum TypeKeys { CONFIG_NODE_WEB3_UNSET = 'CONFIG_NODE_WEB3_UNSET', CONFIG_NODE_CHANGE = 'CONFIG_NODE_CHANGE', CONFIG_NODE_CHANGE_INTENT = 'CONFIG_NODE_CHANGE_INTENT', + CONFIG_NODE_CHANGE_FORCE = 'CONFIG_NODE_CHANGE_FORCE', CONFIG_ADD_CUSTOM_NODE = 'CONFIG_ADD_CUSTOM_NODE', CONFIG_REMOVE_CUSTOM_NODE = 'CONFIG_REMOVE_CUSTOM_NODE', diff --git a/common/sagas/config/node.ts b/common/sagas/config/node.ts index 367c2586..03f6825f 100644 --- a/common/sagas/config/node.ts +++ b/common/sagas/config/node.ts @@ -27,6 +27,7 @@ import { changeNodeIntent, setLatestBlock, AddCustomNodeAction, + ChangeNodeForceAction, ChangeNodeIntentAction } from 'actions/config'; import { showNotification } from 'actions/notifications'; @@ -181,8 +182,30 @@ export function* handleNewNetwork() { yield put(resetWallet()); } +export function* handleNodeChangeForce({ payload: staticNodeIdToSwitchTo }: ChangeNodeForceAction) { + // does not perform node online check before changing nodes + // necessary when switching back from Web3 provider so node + // dropdown does not get stuck if node is offline + + const isStaticNode: boolean = yield select(isStaticNodeId, staticNodeIdToSwitchTo); + + if (!isStaticNode) { + return; + } + + const nodeConfig = yield select(getStaticNodeFromId, staticNodeIdToSwitchTo); + + // force the node change + yield put(changeNode({ networkId: nodeConfig.network, nodeId: staticNodeIdToSwitchTo })); + + // also put the change through as usual so status check and + // error messages occur if the node is unavailable + yield put(changeNodeIntent(staticNodeIdToSwitchTo)); +} + export const node = [ takeEvery(TypeKeys.CONFIG_NODE_CHANGE_INTENT, handleNodeChangeIntent), + takeEvery(TypeKeys.CONFIG_NODE_CHANGE_FORCE, handleNodeChangeForce), takeLatest(TypeKeys.CONFIG_POLL_OFFLINE_STATUS, handlePollOfflineStatus), takeEvery(TypeKeys.CONFIG_LANGUAGE_CHANGE, reload), takeEvery(TypeKeys.CONFIG_ADD_CUSTOM_NODE, switchToNewNode) diff --git a/common/sagas/config/web3.ts b/common/sagas/config/web3.ts index 7853c412..5da68c91 100644 --- a/common/sagas/config/web3.ts +++ b/common/sagas/config/web3.ts @@ -2,7 +2,7 @@ import { TypeKeys as WalletTypeKeys } from 'actions/wallet/constants'; import { Web3Wallet } from 'libs/wallet'; import { SagaIterator } from 'redux-saga'; import { select, put, takeEvery, call } from 'redux-saga/effects'; -import { changeNodeIntent, TypeKeys, web3SetNode } from 'actions/config'; +import { changeNodeForce, TypeKeys, web3SetNode } from 'actions/config'; import { getNodeId, getStaticAltNodeIdToWeb3, getNetworkNameByChainId } from 'selectors/config'; import { setupWeb3Node, Web3Service } from 'libs/nodes/web3'; import { Web3NodeConfig } from 'types/node'; @@ -34,8 +34,8 @@ export function* unsetWeb3NodeOnWalletEvent(action): SagaIterator { } const altNode = yield select(getStaticAltNodeIdToWeb3); - // switch back to a node with the same network as MetaMask/Mist - yield put(changeNodeIntent(altNode)); + // forcefully switch back to a node with the same network as MetaMask/Mist + yield put(changeNodeForce(altNode)); } export function* unsetWeb3Node(): SagaIterator { @@ -46,8 +46,8 @@ export function* unsetWeb3Node(): SagaIterator { } const altNode = yield select(getStaticAltNodeIdToWeb3); - // switch back to a node with the same network as MetaMask/Mist - yield put(changeNodeIntent(altNode)); + // forcefully switch back to a node with the same network as MetaMask/Mist + yield put(changeNodeForce(altNode)); } export const web3 = [ diff --git a/spec/reducers/config/config.spec.ts b/spec/reducers/config/config.spec.ts index 508e9b4a..1c95dd55 100644 --- a/spec/reducers/config/config.spec.ts +++ b/spec/reducers/config/config.spec.ts @@ -2,7 +2,13 @@ import { configuredStore } from 'store'; import { delay } from 'redux-saga'; import { call, cancel, fork, put, take, select } from 'redux-saga/effects'; import { cloneableGenerator, createMockTask } from 'redux-saga/utils'; -import { toggleOffline, changeNode, changeNodeIntent, setLatestBlock } from 'actions/config'; +import { + toggleOffline, + changeNode, + changeNodeIntent, + changeNodeForce, + setLatestBlock +} from 'actions/config'; import { handleNodeChangeIntent, handlePollOfflineStatus, @@ -274,8 +280,8 @@ describe('unsetWeb3Node*', () => { expect(gen.next(node).value).toEqual(select(getStaticAltNodeIdToWeb3)); }); - it('should put changeNodeIntent', () => { - expect(gen.next(alternativeNodeId).value).toEqual(put(changeNodeIntent(alternativeNodeId))); + it('should put changeNodeForce', () => { + expect(gen.next(alternativeNodeId).value).toEqual(put(changeNodeForce(alternativeNodeId))); }); it('should be done', () => { @@ -304,8 +310,8 @@ describe('unsetWeb3NodeOnWalletEvent*', () => { expect(gen.next(mockNodeId).value).toEqual(select(getStaticAltNodeIdToWeb3)); }); - it('should put changeNodeIntent', () => { - expect(gen.next(alternativeNodeId).value).toEqual(put(changeNodeIntent(alternativeNodeId))); + it('should put changeNodeForce', () => { + expect(gen.next(alternativeNodeId).value).toEqual(put(changeNodeForce(alternativeNodeId))); }); it('should be done', () => { diff --git a/spec/sagas/config/node.spec.ts b/spec/sagas/config/node.spec.ts new file mode 100644 index 00000000..d9f9ab93 --- /dev/null +++ b/spec/sagas/config/node.spec.ts @@ -0,0 +1,48 @@ +import { configuredStore } from 'store'; +import { cloneableGenerator } from 'redux-saga/utils'; +import { handleNodeChangeForce } from 'sagas/config/node'; +import { put, select } from 'redux-saga/effects'; +import { isStaticNodeId, getStaticNodeFromId } from 'selectors/config'; +import { changeNode, changeNodeIntent } from 'actions/config'; + +// init module +configuredStore.getState(); + +describe('handleNodeChangeForce*', () => { + const payload: any = 'nodeId'; + const action: any = { payload }; + const gen = cloneableGenerator(handleNodeChangeForce)(action); + const nodeConfig: any = { network: 'network' }; + + it('should select isStaticNodeId', () => { + expect(gen.next().value).toEqual(select(isStaticNodeId, payload)); + }); + + it('should return if not static node', () => { + const clone = gen.clone(); + expect(clone.next(false).done).toEqual(true); + }); + + it('should select getStaticNodeFromId', () => { + expect(gen.next(true).value).toEqual(select(getStaticNodeFromId, payload)); + }); + + it('should force the node change', () => { + expect(gen.next(nodeConfig).value).toEqual( + put( + changeNode({ + networkId: nodeConfig.network, + nodeId: payload + }) + ) + ); + }); + + it('should put a change node intent', () => { + expect(gen.next().value).toEqual(put(changeNodeIntent(payload))); + }); + + it('should be done', () => { + expect(gen.next().done).toEqual(true); + }); +}); From 3953af5f03aeb9d291e577c1d30e5a4e8e9b5260 Mon Sep 17 00:00:00 2001 From: Kenneth Ashley Date: Wed, 28 Feb 2018 23:58:35 -0500 Subject: [PATCH 16/52] Remove exclusion of font-awesome assets (#1172) Excluding font awesome assets causes error due to webpack not knowing how to read the files. --- webpack_config/makeConfig.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/webpack_config/makeConfig.js b/webpack_config/makeConfig.js index c011a8e6..de63fda4 100644 --- a/webpack_config/makeConfig.js +++ b/webpack_config/makeConfig.js @@ -104,7 +104,6 @@ module.exports = function(opts = {}) { .map(dir => path.resolve(config.path.src, dir)) .concat([config.path.modules]), - exclude: /node_modules(?!\/font-awesome)/, use: ['style-loader', 'css-loader', 'sass-loader'] }, { @@ -124,7 +123,6 @@ module.exports = function(opts = {}) { // Images rules.push({ include: [path.resolve(config.path.assets), path.resolve(config.path.modules)], - exclude: /node_modules(?!\/font-awesome)/, test: /\.(gif|png|jpe?g|svg)$/i, use: [ { @@ -159,7 +157,6 @@ module.exports = function(opts = {}) { // Fonts rules.push({ include: [path.resolve(config.path.assets), path.resolve(config.path.modules)], - exclude: /node_modules(?!\/font-awesome)/, test: /\.(ico|eot|otf|webp|ttf|woff|woff2)(\?.*)?$/, loader: 'file-loader' }); From 95072d350ac0c85744849fda6044e2e831dfdb8a Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Thu, 1 Mar 2018 11:45:49 -0600 Subject: [PATCH 17/52] chore(package): update html-webpack-plugin to version 3.0.3 (#1212) Closes #1211 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8014896f..ca6376a9 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "friendly-errors-webpack-plugin": "1.6.1", "glob": "7.1.2", "hoist-non-react-statics": "2.5.0", - "html-webpack-plugin": "2.30.1", + "html-webpack-plugin": "3.0.3", "husky": "0.14.3", "image-webpack-loader": "4.1.0", "jest": "22.1.4", From 9ef1920fe09de71370a7315f3bb9b04e5ddec7ec Mon Sep 17 00:00:00 2001 From: James Prado Date: Thu, 1 Mar 2018 12:53:29 -0500 Subject: [PATCH 18/52] Update dropdowns, inputs, and textareas (#1169) * Align footer to bottom * Fix request payment offset padding * Update request payment padding * Add new Input and Dropdown components * Fix offset margins in equiv vals * Update all send tx inputs & dropdowns * Update generate wallet dropdowns * Update inputs & dropdowns for contracts tab * Add inputs & dropdowns for all but swap tab * amend * Fix imports * inputs are invalid when not disabled or readonly * Fix offset refresh button * Add togglable password back to wallet generation * Update swap inputs, textareas, and dropdowns * Update any outstanding inputs * Make UnitDropDown searchable * unitdropdown searchanble if options > 10 * Fix css issues * Reset before setting currentTo --- common/actions/swap/actionTypes.ts | 2 +- common/components/AddressField.tsx | 26 ++- .../AddressInputFactory.tsx | 2 - common/components/AmountField.tsx | 17 +- .../BalanceSidebar/EquivalentValues.scss | 1 - .../TokenBalances/AddCustomTokenForm.tsx | 13 +- common/components/DataField.tsx | 25 +-- common/components/GasLimitField.tsx | 35 ++-- .../GenerateKeystoreModal/index.tsx | 46 +++-- .../Header/components/CustomNodeModal.tsx | 13 +- common/components/Header/index.scss | 6 +- common/components/Header/index.tsx | 4 +- common/components/NonceField.scss | 10 +- common/components/NonceField.tsx | 30 ++- .../SendButtonFactory/SendButtonFactory.tsx | 15 +- .../SendEverything/SendEverything.tsx | 2 +- .../TXMetaDataPanel/TXMetaDataPanel.tsx | 8 +- .../components/AdvancedGas.tsx | 26 +-- common/components/TogglablePassword.tsx | 13 +- .../TransactionDataTable.tsx | 6 +- .../components/UnitDropDown/UnitDropDown.tsx | 38 ++-- .../components/DeterministicWalletsModal.tsx | 7 +- .../WalletDecrypt/components/Keystore.tsx | 26 +-- .../WalletDecrypt/components/Mnemonic.tsx | 4 +- .../WalletDecrypt/components/PrivateKey.tsx | 44 +++-- .../WalletDecrypt/components/ViewOnly.tsx | 7 +- common/components/ui/ConditionalInput.tsx | 5 +- common/components/ui/Dropdown.tsx | 158 +++++---------- common/components/ui/Help.scss | 15 +- common/components/ui/Input.scss | 84 ++++++++ common/components/ui/Input.tsx | 30 +++ common/components/ui/OldDropdown.tsx | 123 ++++++++++++ common/components/ui/SimpleButton.scss | 7 + common/components/ui/SimpleButton.tsx | 5 +- common/components/ui/SimpleDropdown.tsx | 26 --- common/components/ui/SwapDropdown.scss | 13 ++ common/components/ui/SwapDropdown.tsx | 131 ++++++------- common/components/ui/TextArea.tsx | 30 +++ common/components/ui/index.ts | 5 +- common/containers/Tabs/BroadcastTx/index.tsx | 28 +-- .../components/TxHashInput.tsx | 7 +- .../Tabs/Contracts/components/Deploy.scss | 9 +- .../Tabs/Contracts/components/Deploy.tsx | 46 +++-- .../components/AmountField.tsx | 37 ++-- .../components/InteractExplorer/index.tsx | 82 ++++---- .../components/InteractForm/index.tsx | 72 +++---- .../Tabs/ENS/components/NameInput.scss | 4 - .../Tabs/ENS/components/NameInput.tsx | 31 ++- .../components/Keystore/EnterPassword.scss | 10 +- .../components/Keystore/EnterPassword.tsx | 60 +++--- .../components/Keystore/PaperWallet.tsx | 5 +- .../components/Mnemonic/Word.tsx | 17 +- .../components/RequestPayment.scss | 13 +- .../components/RequestPayment.tsx | 12 +- .../SendTransaction/components/WalletInfo.tsx | 10 +- .../components/SignMessage/index.scss | 6 +- .../components/SignMessage/index.tsx | 38 ++-- .../components/VerifyMessage/index.tsx | 28 ++- .../Tabs/Swap/components/CurrencySwap.scss | 29 ++- .../Tabs/Swap/components/CurrencySwap.tsx | 181 ++++++++++-------- .../Tabs/Swap/components/LiteSend/Fields.tsx | 6 +- .../Tabs/Swap/components/PartThree.tsx | 6 +- .../Tabs/Swap/components/PaymentInfo.tsx | 7 +- .../Tabs/Swap/components/ReceivingAddress.tsx | 17 +- .../Tabs/Swap/components/SupportFooter.tsx | 17 +- .../Tabs/Swap/components/SwapInfoHeader.tsx | 10 +- common/containers/Tabs/Swap/index.tsx | 2 +- common/reducers/swap/index.ts | 4 +- common/reducers/swap/types.ts | 2 +- common/sagas/swap/liteSend.ts | 10 +- common/sass/styles/flexbox.scss | 6 +- common/sass/styles/overrides/forms.scss | 2 - .../sass/styles/overrides/input-groups.scss | 18 +- .../sass/styles/overrides/react-select.scss | 160 ++++++++-------- common/sass/variables/colors.scss | 2 +- spec/pages/__snapshots__/Swap.spec.tsx.snap | 4 +- spec/reducers/swap.spec.ts | 4 +- 77 files changed, 1131 insertions(+), 929 deletions(-) create mode 100644 common/components/ui/Input.scss create mode 100644 common/components/ui/Input.tsx create mode 100644 common/components/ui/OldDropdown.tsx create mode 100644 common/components/ui/SimpleButton.scss delete mode 100644 common/components/ui/SimpleDropdown.tsx create mode 100644 common/components/ui/TextArea.tsx diff --git a/common/actions/swap/actionTypes.ts b/common/actions/swap/actionTypes.ts index 2ef859dd..b5b636e1 100644 --- a/common/actions/swap/actionTypes.ts +++ b/common/actions/swap/actionTypes.ts @@ -8,7 +8,7 @@ export interface Pairs { } export interface SwapInput { - id: string; + label: string; amount: number | string; } diff --git a/common/components/AddressField.tsx b/common/components/AddressField.tsx index aff92573..a9e1f065 100644 --- a/common/components/AddressField.tsx +++ b/common/components/AddressField.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { AddressFieldFactory } from './AddressFieldFactory'; import { donationAddressMap } from 'config'; +import translate from 'translations'; +import { Input } from 'components/ui'; interface Props { isReadOnly?: boolean; @@ -9,16 +11,20 @@ interface Props { export const AddressField: React.SFC = ({ isReadOnly }) => ( ( - - - +
    + +
    )} /> ); diff --git a/common/components/AddressFieldFactory/AddressInputFactory.tsx b/common/components/AddressFieldFactory/AddressInputFactory.tsx index bb00ddd2..4723a6cf 100644 --- a/common/components/AddressFieldFactory/AddressInputFactory.tsx +++ b/common/components/AddressFieldFactory/AddressInputFactory.tsx @@ -1,6 +1,5 @@ import React, { Component } from 'react'; import { Identicon, Spinner } from 'components/ui'; -import translate from 'translations'; import { Query } from 'components/renderCbs'; import { ICurrentTo, getCurrentTo, isValidCurrentTo } from 'selectors/transaction'; import { connect } from 'react-redux'; @@ -49,7 +48,6 @@ class AddressInputFactoryClass extends Component { return (
    - diff --git a/common/components/AmountField.tsx b/common/components/AmountField.tsx index 3a215fe3..9e71fb67 100644 --- a/common/components/AmountField.tsx +++ b/common/components/AmountField.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { AmountFieldFactory } from './AmountFieldFactory'; import { UnitDropDown } from 'components'; import translate, { translateRaw } from 'translations'; +import { Input } from 'components/ui'; interface Props { hasUnitDropdown?: boolean; @@ -16,12 +17,12 @@ export const AmountField: React.SFC = ({ }) => ( ( - - -
    - +
    -
    + +
    )} /> ); diff --git a/common/components/BalanceSidebar/EquivalentValues.scss b/common/components/BalanceSidebar/EquivalentValues.scss index 0466c8d7..437811c0 100644 --- a/common/components/BalanceSidebar/EquivalentValues.scss +++ b/common/components/BalanceSidebar/EquivalentValues.scss @@ -41,7 +41,6 @@ flex-wrap: nowrap; align-items: center; &-fiat-symbol { - height: 18px; width: 18px; margin-right: 0.5rem; text-align: center; diff --git a/common/components/BalanceSidebar/TokenBalances/AddCustomTokenForm.tsx b/common/components/BalanceSidebar/TokenBalances/AddCustomTokenForm.tsx index efc52718..29c4d742 100644 --- a/common/components/BalanceSidebar/TokenBalances/AddCustomTokenForm.tsx +++ b/common/components/BalanceSidebar/TokenBalances/AddCustomTokenForm.tsx @@ -1,9 +1,8 @@ import React from 'react'; -import classnames from 'classnames'; import { HELP_ARTICLE } from 'config'; import { isPositiveIntegerOrZero, isValidETHAddress } from 'libs/validators'; import translate from 'translations'; -import { HelpLink } from 'components/ui'; +import { HelpLink, Input } from 'components/ui'; import './AddCustomTokenForm.scss'; import { Token } from 'types/network'; @@ -42,7 +41,6 @@ export default class AddCustomTokenForm extends React.PureComponent {field.label} - = () => ( ( - <> - - - +
    + +
    )} /> ); diff --git a/common/components/GasLimitField.tsx b/common/components/GasLimitField.tsx index f5b1c8af..a5d62eb7 100644 --- a/common/components/GasLimitField.tsx +++ b/common/components/GasLimitField.tsx @@ -4,6 +4,7 @@ import translate from 'translations'; import { gasLimitValidator } from 'libs/validators'; import { InlineSpinner } from 'components/ui/InlineSpinner'; import './GasLimitField.scss'; +import { Input } from 'components/ui'; interface Props { customLabel?: string; @@ -13,22 +14,24 @@ interface Props { export const GasLimitField: React.SFC = ({ customLabel, disabled }) => ( ( - -
    - {customLabel ? : } -
    - -
    - - +
    +
    - + +
    ) : null; }} /> diff --git a/common/components/SendButtonFactory/SendButtonFactory.tsx b/common/components/SendButtonFactory/SendButtonFactory.tsx index 4fbd62a6..dfb815ec 100644 --- a/common/components/SendButtonFactory/SendButtonFactory.tsx +++ b/common/components/SendButtonFactory/SendButtonFactory.tsx @@ -9,6 +9,7 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { AppState } from 'reducers'; import { ConfirmationModal } from 'components/ConfirmationModal'; +import { TextArea } from 'components/ui'; export interface CallbackProps { onClick(): void; @@ -42,12 +43,7 @@ class SendButtonFactoryClass extends Component { ? 'Transaction Parameters' : translate('SEND_raw')} -