diff --git a/.gitignore b/.gitignore index 24c242ba52ac0d1a9862fed2a3b861e3c6ead19b..6152d1bbd5dd0a0edf5071441c07b2e618fc826e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ dist lib # css files -.css +*.css # logs *.log* diff --git a/packages/light-react/package.json b/packages/light-react/package.json index d850c0c39cde0ad6d9c4e5570ed6fdcc0242b59c..3a8a8b61bd53b6f5395229d943591e808644543a 100644 --- a/packages/light-react/package.json +++ b/packages/light-react/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@parity/api": "^2.1.22", - "@parity/light.js": "https://github.com/parity-js/light.js#24ed8bed60917207a84d85cd5622636f8489fd7a", + "@parity/light.js": "https://github.com/parity-js/light.js#99ee612acd7ee69554839a09d6c094251043bc3b", "@parity/shared": "^3.0.1", "is-electron": "^2.1.0", "light-hoc": "^0.1.0", diff --git a/packages/light-react/src/Accounts/AccountsList/AccountsList.js b/packages/light-react/src/Accounts/AccountsList/AccountsList.js index b8e7e30f788707828454a9fc308125f3da815111..1cb732e8623b5ce435a93fb583aab39b210cd0b8 100644 --- a/packages/light-react/src/Accounts/AccountsList/AccountsList.js +++ b/packages/light-react/src/Accounts/AccountsList/AccountsList.js @@ -27,7 +27,9 @@ class AccountsList extends Component { parityStore: { api } } = this.props; // Set default account to the clicked one, and go to Tokens on complete - this.subscription = api.parity + // TODO Not 100% clean, I don't want any api.abc.method() in any React + // component. + api.parity .setNewDappsDefaultAddress(address) .then(() => history.push('/tokens')); }; diff --git a/packages/light-react/src/Accounts/CreateAccount/AccountPassword/AccountPassword.js b/packages/light-react/src/Accounts/CreateAccount/AccountPassword/AccountPassword.js index 836d4a426ef1f991c2618dece3152a978c880a8e..7b571894093ace086adcabfaad0e578bd5d16a1d 100644 --- a/packages/light-react/src/Accounts/CreateAccount/AccountPassword/AccountPassword.js +++ b/packages/light-react/src/Accounts/CreateAccount/AccountPassword/AccountPassword.js @@ -30,7 +30,11 @@ class AccountPassword extends Component { }; handleSubmit = () => { - const { createAccountStore, history, location: { pathname } } = this.props; + const { + createAccountStore, + history, + location: { pathname } + } = this.props; const { hint, password } = this.state; createAccountStore.setPassword(password); createAccountStore.setHint(hint); @@ -82,11 +86,12 @@ class AccountPassword extends Component { diff --git a/packages/light-react/src/App/App.css b/packages/light-react/src/App/App.css deleted file mode 100644 index e2ae348cd2d8cde136681f684bf934989510db7f..0000000000000000000000000000000000000000 --- a/packages/light-react/src/App/App.css +++ /dev/null @@ -1,1399 +0,0 @@ -/* Copyright 2015-2018 Parity Technologies (UK) Ltd. */ -/* This file is part of Parity. */ -/* SPDX-License-Identifier: MIT */ -.container-fluid, -.container { - margin-right: auto; - margin-left: auto; } - -.container-fluid { - padding-right: 2rem; - padding-left: 2rem; } - -.row { - box-sizing: border-box; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 0; - -ms-flex: 0 1 auto; - flex: 0 1 auto; - -webkit-box-orient: horizontal; - -webkit-box-direction: normal; - -ms-flex-direction: row; - flex-direction: row; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - margin-right: -19px; - margin-left: -19px; } - -.row.reverse { - -webkit-box-orient: horizontal; - -webkit-box-direction: reverse; - -ms-flex-direction: row-reverse; - flex-direction: row-reverse; } - -.col.reverse { - -webkit-box-orient: vertical; - -webkit-box-direction: reverse; - -ms-flex-direction: column-reverse; - flex-direction: column-reverse; } - -.col-xs, -.col-xs-1, -.col-xs-2, -.col-xs-3, -.col-xs-4, -.col-xs-5, -.col-xs-6, -.col-xs-7, -.col-xs-8, -.col-xs-9, -.col-xs-10, -.col-xs-11, -.col-xs-12, -.col-xs-offset-0, -.col-xs-offset-1, -.col-xs-offset-2, -.col-xs-offset-3, -.col-xs-offset-4, -.col-xs-offset-5, -.col-xs-offset-6, -.col-xs-offset-7, -.col-xs-offset-8, -.col-xs-offset-9, -.col-xs-offset-10, -.col-xs-offset-11, -.col-xs-offset-12 { - box-sizing: border-box; - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - padding-right: 19px; - padding-left: 19px; } - -.col-xs { - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -ms-flex-preferred-size: 0; - flex-basis: 0; - max-width: 100%; } - -.col-xs-1 { - -ms-flex-preferred-size: 8.33333333%; - flex-basis: 8.33333333%; - max-width: 8.33333333%; } - -.col-xs-2 { - -ms-flex-preferred-size: 16.66666667%; - flex-basis: 16.66666667%; - max-width: 16.66666667%; } - -.col-xs-3 { - -ms-flex-preferred-size: 25%; - flex-basis: 25%; - max-width: 25%; } - -.col-xs-4 { - -ms-flex-preferred-size: 33.33333333%; - flex-basis: 33.33333333%; - max-width: 33.33333333%; } - -.col-xs-5 { - -ms-flex-preferred-size: 41.66666667%; - flex-basis: 41.66666667%; - max-width: 41.66666667%; } - -.col-xs-6 { - -ms-flex-preferred-size: 50%; - flex-basis: 50%; - max-width: 50%; } - -.col-xs-7 { - -ms-flex-preferred-size: 58.33333333%; - flex-basis: 58.33333333%; - max-width: 58.33333333%; } - -.col-xs-8 { - -ms-flex-preferred-size: 66.66666667%; - flex-basis: 66.66666667%; - max-width: 66.66666667%; } - -.col-xs-9 { - -ms-flex-preferred-size: 75%; - flex-basis: 75%; - max-width: 75%; } - -.col-xs-10 { - -ms-flex-preferred-size: 83.33333333%; - flex-basis: 83.33333333%; - max-width: 83.33333333%; } - -.col-xs-11 { - -ms-flex-preferred-size: 91.66666667%; - flex-basis: 91.66666667%; - max-width: 91.66666667%; } - -.col-xs-12 { - -ms-flex-preferred-size: 100%; - flex-basis: 100%; - max-width: 100%; } - -.col-xs-offset-0 { - margin-left: 0; } - -.col-xs-offset-1 { - margin-left: 8.33333333%; } - -.col-xs-offset-2 { - margin-left: 16.66666667%; } - -.col-xs-offset-3 { - margin-left: 25%; } - -.col-xs-offset-4 { - margin-left: 33.33333333%; } - -.col-xs-offset-5 { - margin-left: 41.66666667%; } - -.col-xs-offset-6 { - margin-left: 50%; } - -.col-xs-offset-7 { - margin-left: 58.33333333%; } - -.col-xs-offset-8 { - margin-left: 66.66666667%; } - -.col-xs-offset-9 { - margin-left: 75%; } - -.col-xs-offset-10 { - margin-left: 83.33333333%; } - -.col-xs-offset-11 { - margin-left: 91.66666667%; } - -.start-xs { - -webkit-box-pack: start; - -ms-flex-pack: start; - justify-content: flex-start; - text-align: start; } - -.center-xs { - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; } - -.end-xs { - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - text-align: end; } - -.top-xs { - -webkit-box-align: start; - -ms-flex-align: start; - align-items: flex-start; } - -.middle-xs { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; } - -.bottom-xs { - -webkit-box-align: end; - -ms-flex-align: end; - align-items: flex-end; } - -.around-xs { - -ms-flex-pack: distribute; - justify-content: space-around; } - -.between-xs { - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; } - -.first-xs { - -webkit-box-ordinal-group: 0; - -ms-flex-order: -1; - order: -1; } - -.last-xs { - -webkit-box-ordinal-group: 2; - -ms-flex-order: 1; - order: 1; } - -@media only screen and (min-width: 768px) { - .container { - width: 806px; } - .col-sm, - .col-sm-1, - .col-sm-2, - .col-sm-3, - .col-sm-4, - .col-sm-5, - .col-sm-6, - .col-sm-7, - .col-sm-8, - .col-sm-9, - .col-sm-10, - .col-sm-11, - .col-sm-12, - .col-sm-offset-0, - .col-sm-offset-1, - .col-sm-offset-2, - .col-sm-offset-3, - .col-sm-offset-4, - .col-sm-offset-5, - .col-sm-offset-6, - .col-sm-offset-7, - .col-sm-offset-8, - .col-sm-offset-9, - .col-sm-offset-10, - .col-sm-offset-11, - .col-sm-offset-12 { - box-sizing: border-box; - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - padding-right: 19px; - padding-left: 19px; } - .col-sm { - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -ms-flex-preferred-size: 0; - flex-basis: 0; - max-width: 100%; } - .col-sm-1 { - -ms-flex-preferred-size: 8.33333333%; - flex-basis: 8.33333333%; - max-width: 8.33333333%; } - .col-sm-2 { - -ms-flex-preferred-size: 16.66666667%; - flex-basis: 16.66666667%; - max-width: 16.66666667%; } - .col-sm-3 { - -ms-flex-preferred-size: 25%; - flex-basis: 25%; - max-width: 25%; } - .col-sm-4 { - -ms-flex-preferred-size: 33.33333333%; - flex-basis: 33.33333333%; - max-width: 33.33333333%; } - .col-sm-5 { - -ms-flex-preferred-size: 41.66666667%; - flex-basis: 41.66666667%; - max-width: 41.66666667%; } - .col-sm-6 { - -ms-flex-preferred-size: 50%; - flex-basis: 50%; - max-width: 50%; } - .col-sm-7 { - -ms-flex-preferred-size: 58.33333333%; - flex-basis: 58.33333333%; - max-width: 58.33333333%; } - .col-sm-8 { - -ms-flex-preferred-size: 66.66666667%; - flex-basis: 66.66666667%; - max-width: 66.66666667%; } - .col-sm-9 { - -ms-flex-preferred-size: 75%; - flex-basis: 75%; - max-width: 75%; } - .col-sm-10 { - -ms-flex-preferred-size: 83.33333333%; - flex-basis: 83.33333333%; - max-width: 83.33333333%; } - .col-sm-11 { - -ms-flex-preferred-size: 91.66666667%; - flex-basis: 91.66666667%; - max-width: 91.66666667%; } - .col-sm-12 { - -ms-flex-preferred-size: 100%; - flex-basis: 100%; - max-width: 100%; } - .col-sm-offset-0 { - margin-left: 0; } - .col-sm-offset-1 { - margin-left: 8.33333333%; } - .col-sm-offset-2 { - margin-left: 16.66666667%; } - .col-sm-offset-3 { - margin-left: 25%; } - .col-sm-offset-4 { - margin-left: 33.33333333%; } - .col-sm-offset-5 { - margin-left: 41.66666667%; } - .col-sm-offset-6 { - margin-left: 50%; } - .col-sm-offset-7 { - margin-left: 58.33333333%; } - .col-sm-offset-8 { - margin-left: 66.66666667%; } - .col-sm-offset-9 { - margin-left: 75%; } - .col-sm-offset-10 { - margin-left: 83.33333333%; } - .col-sm-offset-11 { - margin-left: 91.66666667%; } - .start-sm { - -webkit-box-pack: start; - -ms-flex-pack: start; - justify-content: flex-start; - text-align: start; } - .center-sm { - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; } - .end-sm { - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - text-align: end; } - .top-sm { - -webkit-box-align: start; - -ms-flex-align: start; - align-items: flex-start; } - .middle-sm { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; } - .bottom-sm { - -webkit-box-align: end; - -ms-flex-align: end; - align-items: flex-end; } - .around-sm { - -ms-flex-pack: distribute; - justify-content: space-around; } - .between-sm { - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; } - .first-sm { - -webkit-box-ordinal-group: 0; - -ms-flex-order: -1; - order: -1; } - .last-sm { - -webkit-box-ordinal-group: 2; - -ms-flex-order: 1; - order: 1; } } - -@media only screen and (min-width: 960px) { - .container { - width: 998px; } - .col-md, - .col-md-1, - .col-md-2, - .col-md-3, - .col-md-4, - .col-md-5, - .col-md-6, - .col-md-7, - .col-md-8, - .col-md-9, - .col-md-10, - .col-md-11, - .col-md-12, - .col-md-offset-0, - .col-md-offset-1, - .col-md-offset-2, - .col-md-offset-3, - .col-md-offset-4, - .col-md-offset-5, - .col-md-offset-6, - .col-md-offset-7, - .col-md-offset-8, - .col-md-offset-9, - .col-md-offset-10, - .col-md-offset-11, - .col-md-offset-12 { - box-sizing: border-box; - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - padding-right: 19px; - padding-left: 19px; } - .col-md { - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -ms-flex-preferred-size: 0; - flex-basis: 0; - max-width: 100%; } - .col-md-1 { - -ms-flex-preferred-size: 8.33333333%; - flex-basis: 8.33333333%; - max-width: 8.33333333%; } - .col-md-2 { - -ms-flex-preferred-size: 16.66666667%; - flex-basis: 16.66666667%; - max-width: 16.66666667%; } - .col-md-3 { - -ms-flex-preferred-size: 25%; - flex-basis: 25%; - max-width: 25%; } - .col-md-4 { - -ms-flex-preferred-size: 33.33333333%; - flex-basis: 33.33333333%; - max-width: 33.33333333%; } - .col-md-5 { - -ms-flex-preferred-size: 41.66666667%; - flex-basis: 41.66666667%; - max-width: 41.66666667%; } - .col-md-6 { - -ms-flex-preferred-size: 50%; - flex-basis: 50%; - max-width: 50%; } - .col-md-7 { - -ms-flex-preferred-size: 58.33333333%; - flex-basis: 58.33333333%; - max-width: 58.33333333%; } - .col-md-8 { - -ms-flex-preferred-size: 66.66666667%; - flex-basis: 66.66666667%; - max-width: 66.66666667%; } - .col-md-9 { - -ms-flex-preferred-size: 75%; - flex-basis: 75%; - max-width: 75%; } - .col-md-10 { - -ms-flex-preferred-size: 83.33333333%; - flex-basis: 83.33333333%; - max-width: 83.33333333%; } - .col-md-11 { - -ms-flex-preferred-size: 91.66666667%; - flex-basis: 91.66666667%; - max-width: 91.66666667%; } - .col-md-12 { - -ms-flex-preferred-size: 100%; - flex-basis: 100%; - max-width: 100%; } - .col-md-offset-0 { - margin-left: 0; } - .col-md-offset-1 { - margin-left: 8.33333333%; } - .col-md-offset-2 { - margin-left: 16.66666667%; } - .col-md-offset-3 { - margin-left: 25%; } - .col-md-offset-4 { - margin-left: 33.33333333%; } - .col-md-offset-5 { - margin-left: 41.66666667%; } - .col-md-offset-6 { - margin-left: 50%; } - .col-md-offset-7 { - margin-left: 58.33333333%; } - .col-md-offset-8 { - margin-left: 66.66666667%; } - .col-md-offset-9 { - margin-left: 75%; } - .col-md-offset-10 { - margin-left: 83.33333333%; } - .col-md-offset-11 { - margin-left: 91.66666667%; } - .start-md { - -webkit-box-pack: start; - -ms-flex-pack: start; - justify-content: flex-start; - text-align: start; } - .center-md { - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; } - .end-md { - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - text-align: end; } - .top-md { - -webkit-box-align: start; - -ms-flex-align: start; - align-items: flex-start; } - .middle-md { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; } - .bottom-md { - -webkit-box-align: end; - -ms-flex-align: end; - align-items: flex-end; } - .around-md { - -ms-flex-pack: distribute; - justify-content: space-around; } - .between-md { - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; } - .first-md { - -webkit-box-ordinal-group: 0; - -ms-flex-order: -1; - order: -1; } - .last-md { - -webkit-box-ordinal-group: 2; - -ms-flex-order: 1; - order: 1; } } - -@media only screen and (min-width: 1280px) { - .container { - width: 1318px; } - .col-lg, - .col-lg-1, - .col-lg-2, - .col-lg-3, - .col-lg-4, - .col-lg-5, - .col-lg-6, - .col-lg-7, - .col-lg-8, - .col-lg-9, - .col-lg-10, - .col-lg-11, - .col-lg-12, - .col-lg-offset-0, - .col-lg-offset-1, - .col-lg-offset-2, - .col-lg-offset-3, - .col-lg-offset-4, - .col-lg-offset-5, - .col-lg-offset-6, - .col-lg-offset-7, - .col-lg-offset-8, - .col-lg-offset-9, - .col-lg-offset-10, - .col-lg-offset-11, - .col-lg-offset-12 { - box-sizing: border-box; - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - padding-right: 19px; - padding-left: 19px; } - .col-lg { - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -ms-flex-preferred-size: 0; - flex-basis: 0; - max-width: 100%; } - .col-lg-1 { - -ms-flex-preferred-size: 8.33333333%; - flex-basis: 8.33333333%; - max-width: 8.33333333%; } - .col-lg-2 { - -ms-flex-preferred-size: 16.66666667%; - flex-basis: 16.66666667%; - max-width: 16.66666667%; } - .col-lg-3 { - -ms-flex-preferred-size: 25%; - flex-basis: 25%; - max-width: 25%; } - .col-lg-4 { - -ms-flex-preferred-size: 33.33333333%; - flex-basis: 33.33333333%; - max-width: 33.33333333%; } - .col-lg-5 { - -ms-flex-preferred-size: 41.66666667%; - flex-basis: 41.66666667%; - max-width: 41.66666667%; } - .col-lg-6 { - -ms-flex-preferred-size: 50%; - flex-basis: 50%; - max-width: 50%; } - .col-lg-7 { - -ms-flex-preferred-size: 58.33333333%; - flex-basis: 58.33333333%; - max-width: 58.33333333%; } - .col-lg-8 { - -ms-flex-preferred-size: 66.66666667%; - flex-basis: 66.66666667%; - max-width: 66.66666667%; } - .col-lg-9 { - -ms-flex-preferred-size: 75%; - flex-basis: 75%; - max-width: 75%; } - .col-lg-10 { - -ms-flex-preferred-size: 83.33333333%; - flex-basis: 83.33333333%; - max-width: 83.33333333%; } - .col-lg-11 { - -ms-flex-preferred-size: 91.66666667%; - flex-basis: 91.66666667%; - max-width: 91.66666667%; } - .col-lg-12 { - -ms-flex-preferred-size: 100%; - flex-basis: 100%; - max-width: 100%; } - .col-lg-offset-0 { - margin-left: 0; } - .col-lg-offset-1 { - margin-left: 8.33333333%; } - .col-lg-offset-2 { - margin-left: 16.66666667%; } - .col-lg-offset-3 { - margin-left: 25%; } - .col-lg-offset-4 { - margin-left: 33.33333333%; } - .col-lg-offset-5 { - margin-left: 41.66666667%; } - .col-lg-offset-6 { - margin-left: 50%; } - .col-lg-offset-7 { - margin-left: 58.33333333%; } - .col-lg-offset-8 { - margin-left: 66.66666667%; } - .col-lg-offset-9 { - margin-left: 75%; } - .col-lg-offset-10 { - margin-left: 83.33333333%; } - .col-lg-offset-11 { - margin-left: 91.66666667%; } - .start-lg { - -webkit-box-pack: start; - -ms-flex-pack: start; - justify-content: flex-start; - text-align: start; } - .center-lg { - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - text-align: center; } - .end-lg { - -webkit-box-pack: end; - -ms-flex-pack: end; - justify-content: flex-end; - text-align: end; } - .top-lg { - -webkit-box-align: start; - -ms-flex-align: start; - align-items: flex-start; } - .middle-lg { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; } - .bottom-lg { - -webkit-box-align: end; - -ms-flex-align: end; - align-items: flex-end; } - .around-lg { - -ms-flex-pack: distribute; - justify-content: space-around; } - .between-lg { - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; } - .first-lg { - -webkit-box-ordinal-group: 0; - -ms-flex-order: -1; - order: -1; } - .last-lg { - -webkit-box-ordinal-group: 2; - -ms-flex-order: 1; - order: 1; } } - -@viewport { - zoom: 1.0; - width: extend-to-zoom; } - -@-ms-viewport { - width: extend-to-zoom; - zoom: 1.0; } - -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, font, img, ins, kbd, q, s, samp, small, strike, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { - margin: 0; - padding: 0; - font-size: 100%; - vertical-align: baseline; - border: 0; - outline: 0; - background: transparent; - font-feature-settings: "kern", "liga", "pnum"; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - text-size-adjust: 100%; } - -blockquote, q { - quotes: none; } - -input:focus, select:focus, button:focus { - outline: 0; } - -table { - border-collapse: collapse; - border-spacing: 0; } - -ul, ol { - list-style: none; } - -* { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; } - -html { - font-size: 16px; - height: 100%; } - -body { - user-select: none; - background-color: #A5BFDA; - background-image: linear-gradient(#A5BFDA, #BFCDDC); - background-repeat: no-repeat; - background-size: cover; - color: #222; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - font-weight: 400; - font-size: 1rem; - line-height: 1.3rem; - min-height: 100%; } - -.hidden { - display: none; } - -a, a:link, a:visited { - color: #222; - text-decoration: none; } - a:hover, a:link:hover, a:visited:hover { - cursor: default; } - -.box { - display: block; - position: relative; } - .box.-card { - z-index: 1; - padding: 1rem; - border-radius: 0.25rem; - background-color: #fff; - border: 0px solid #fff; - overflow: hidden; - box-shadow: 0 0.125rem 0.5rem rgba(34, 34, 34, 0.125); } - .box.-card.-clickable { - transition: box-shadow ease 0.125s; } - .box.-card.-clickable:hover { - border-color: #160DF6; - box-shadow: 0 0.125rem 0.675rem rgba(34, 34, 34, 0.175); - cursor: default; } - .box.-card.-clickable:active { - border-color: #160DF6; - box-shadow: 0 0.125rem 0.325rem rgba(34, 34, 34, 0.175); - cursor: default; } - .box.-card-drawer { - margin: 1rem -2rem -2rem; - padding: 1rem 2rem 2rem; - border-top: 1px solid #e0e0e0; - box-shadow: 0 0.125rem 0.325rem rgba(34, 34, 34, 0.075) inset; - background-color: #fdfdfd; } - .box.-scroller { - max-height: 22rem; - overflow-x: hidden; - overflow-y: auto; } - .box.-padded { - padding: 0.5rem; } - .box.-apart { - margin-top: 1rem; - margin-bottom: 1rem; } - .box.-apart:first-child { - margin-top: 0; } - .box.-apart:last-child { - margin-bottom: 0; } - .box.-pull-up { - margin-top: -1rem; - margin-bottom: 1rem; } - .box.-stacked { - margin-bottom: 0.5rem; } - .box.-stacked:last-child { - margin-bottom: 0; } - -.button { - color: #160DF6; - background-color: transparent; - border-radius: 1rem; - border: 2px solid #160DF6; - font-size: 0.69444rem; - font-weight: 600; - line-height: 1.3; - padding: 0.325rem 0.675rem; - text-transform: uppercase; } - .button:hover { - background-color: #160DF6; - color: #f9f9f9; } - .button:active { - background-color: #1209ed; - color: #f9f9f9; } - .button:disabled { - opacity: 0.5; - border-color: #ddd; - background-color: #ddd; - color: #888; } - .button.-tiny { - font-size: 0.69444rem; - text-transform: none; - border: 0; - border-radius: 2px; - color: #222; - background-size: auto 0.675rem; - background-position: left center; - background-repeat: no-repeat; - background-color: transparent; - padding: 0 0 0 0.925rem; - opacity: 0.425; } - .button.-tiny:hover { - opacity: 0.625; - background-color: transparent; } - .button.-tiny:active { - opacity: 0.75; - background-color: transparent; } - .button.-tiny.-reload { - background-image: url("../assets/img/icons/reload.svg"); } - .button.-utility { - font-size: 0.5787rem; - border-width: 0; - background-color: #ddd; - color: rgba(34, 34, 34, 0.75); - padding: 0.175rem 0.325rem 0.125rem; - opacity: 0.8; - border-radius: 1rem; } - .button.-utility:hover { - opacity: 0.9; } - .button.-utility:active { - opacity: 1.0; } - .button.-utility.-good { - background-color: #3ec28f; - color: #f9f9f9; } - .button.-utility.-bad { - background-color: #C2473E; - color: #f9f9f9; } - .button.-cancel { - font-size: 0.69444rem; - border-width: 0; - background-color: #ddd; - color: rgba(34, 34, 34, 0.75); - padding: 0.25rem 0.75rem; - opacity: 0.8; - border-radius: 1rem; } - .button.-cancel:hover { - opacity: 0.9; } - .button.-cancel:active { - opacity: 1.0; } - .button.-icon { - text-indent: -9999rem; - background-size: 0.83333rem auto; - background-position: center center; - background-repeat: no-repeat; - border-radius: 0; - border: 0; - opacity: 0.25; } - .button.-icon:hover { - background-color: transparent; - opacity: 0.5; } - .button.-icon:active { - background-color: transparent; - opacity: 1; } - .button.-icon.-clear { - background-image: url("../assets/img/icons/close.svg"); } - .button.-icon:disabled { - opacity: 0; } - -.form_field { - margin: 0.5rem 0; - border-radius: 0.25rem; - background: rgba(221, 221, 221, 0.25); - position: relative; } - .form_field label { - font-size: 0.69444rem; - font-weight: 600; - color: #222; - opacity: 0.75; - padding: 0.5rem 0.5rem 0; - display: block; } - .form_field .form_field_value { - font-size: 0.83333rem; - font-weight: 400; - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - line-height: 1.3rem; - opacity: 0.75; - margin: 0.25rem 0.5rem 0; - padding-bottom: 0.5rem; - overflow: hidden; - word-wrap: break-word; } - .form_field input[type="text"], .form_field input[type="number"], .form_field input[type="tel"], .form_field input[type="email"], .form_field input[type="password"], .form_field textarea { - border: 0; - background: transparent; - font-size: 1rem; - font-weight: 400; - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - line-height: 1.3rem; - width: calc(100% - 1rem); - opacity: 0.75; - padding: 0.5rem; - margin-top: -0.25rem; } - .form_field input[type="text"]:focus, .form_field input[type="number"]:focus, .form_field input[type="tel"]:focus, .form_field input[type="email"]:focus, .form_field input[type="password"]:focus, .form_field textarea:focus { - opacity: 1; } - .form_field input[type="range"] { - -webkit-appearance: none; - width: calc(100% - 1rem); - height: 0.5rem; - border-radius: 0.5rem; - background: rgba(221, 221, 221, 0.5); - outline: none; - padding: 0; - margin: 0.5rem; } - .form_field input[type="range"]::-webkit-slider-thumb { - appearance: none; - width: 1rem; - height: 1rem; - border-radius: 50%; - background: #888; - cursor: pointer; - transition: background .15s ease; } - .form_field input[type="range"]::-webkit-slider-thumb:hover { - background: #222; } - .form_field input[type="range"]:active::-webkit-slider-thumb { - background-color: #160DF6; } - .form_field textarea { - resize: none; - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 0.83333rem; } - .form_field textarea.-sm { - height: 3.5rem; } - .form_field textarea.-md { - height: 4.75rem; } - .form_field textarea.-lg { - height: 8rem; } - -input.form_field_amount[type='number'] { - font-size: 2.98598rem; - line-height: 3.28458rem; - font-weight: 200; - text-align: center; - -webkit-appearance: none; } - input.form_field_amount[type='number']::-webkit-inner-spin-button, input.form_field_amount[type='number']::-webkit-outer-spin-button { - opacity: 1; - -webkit-appearance: none; } - -nav.form-field_nav { - padding: 0 0.5rem 0.5rem; - display: flex; - justify-content: flex-end; } - nav.form-field_nav button { - margin-left: 0.5rem; } - -nav.range-nav { - width: 100%; - padding: 0 0.5rem 0.5rem; - display: flex; - justify-content: space-between; - font-size: 0.69444rem; - font-weight: 600; - text-transform: uppercase; } - nav.range-nav .range-nav_label { - width: 4rem; - color: #888; - font-size: 0.5787rem; } - nav.range-nav .range-nav_label:last-child { - text-align: right; } - nav.range-nav .range-nav_value { - display: block; - width: 8rem; - text-align: center; - color: #222; } - -.list { - padding: 0.5rem; } - .list > li { - margin-bottom: 0.5rem; } - .list > li:last-child { - margin-bottom: 0; } - -.text p, .text ul, .text ol, .text blockquote { - margin: 1rem 0; } - .text p:first-child, .text ul:first-child, .text ol:first-child, .text blockquote:first-child { - margin-top: 0; } - .text p:last-child, .text ul:last-child, .text ol:last-child, .text blockquote:last-child { - margin-bottom: 0; } - -.text.-centered { - text-align: center; } - -.text.-right { - text-align: right; } - -.text.-fixed { - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 0.83333rem; } - -.text strong { - font-weight: 500; } - -.text.-code { - user-select: text; - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - padding: 0.5rem; - background: rgba(221, 221, 221, 0.25); - color: #222; - margin: 0.5rem 0; - font-size: 0.83333rem; - border-radius: 0.25rem; - word-wrap: break-word; } - -.span.-placeholder { - color: #ddd; } - -.wrapper { - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - overflow: hidden; } - .wrapper .content { - overflow: visible; - max-width: 22rem; - margin: 0 auto; } - .wrapper .content .connector { - height: 0.5rem; - display: flex; - justify-content: center; - margin-bottom: -1px; } - .wrapper .content .connector svg { - height: 0.5rem; - width: auto; } - .wrapper .content .connector svg polygon { - fill: #F5F6F6; } - .wrapper .content .window { - background: #F5F6F6; - border-radius: 0.25rem; - overflow: hidden; - box-shadow: 0 0.125rem 0.75rem rgba(34, 34, 34, 0.175), 0 0.125rem 0.125rem rgba(34, 34, 34, 0.1); } - .wrapper .content .window .window_content { - min-height: 7.5rem; } - -.logo { - padding: 1.5rem 0; } - .logo figure { - display: block; - margin: 0 auto; - background-color: #222; - background-image: url("https://www.parity.io/i/logo-small.png"); - background-position: center center; - background-repeat: no-repeat; - background-size: 3rem auto; - border-radius: 100%; - width: 6rem; - height: 6rem; - display: flex; - flex-direction: column; - text-indent: -9999px; - overflow: hidden; } - -.token { - display: flex; - align-items: center; - align-content: center; - justify-content: center; } - .token .token_icon { - width: 2.3rem; - height: 2.3rem; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - align-content: center; } - .token .token_icon img { - display: block; - margin: 0; - height: 1.3rem; - width: auto; } - .token .token_name { - padding-left: 0.325rem; - height: 1.3rem; - flex-grow: 1; - color: #222; - font-weight: 500; } - .token .token_balance { - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - color: #888; - height: 1.3rem; } - .token .token_symbol { - height: 1.3rem; - font-size: 0.69444rem; } - .token .token_symbol:before { - content: ' '; } - .token .token_buttons { - padding-left: 0.5rem; } - -.account { - display: flex; } - .account .account_avatar { - width: 2.3rem; - height: 2.3rem; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - align-content: center; } - .account .account_avatar canvas { - display: block; - height: 2.3rem !important; - width: auto !important; } - .account .account_information { - padding-left: 0.325rem; - overflow: hidden; - flex-grow: 1; } - .account .account_name { - color: #222; - font-weight: 500; } - .account .account_address { - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - color: #888; - font-size: 0.69444rem; - line-height: 0.90278rem; } - .account.-placeholder .account_avatar_placeholder, .account.-placeholder .account_name_placeholder, .account.-placeholder .account_address_placeholder { - background: rgba(221, 221, 221, 0.5); } - .account.-placeholder .account_avatar_placeholder { - width: 2.3rem; - height: 2.3rem; } - .account.-placeholder .account_name_placeholder { - width: 100%; - height: 1.2rem; - margin-bottom: 0.325rem; } - .account.-placeholder .account_address_placeholder { - width: 100%; - height: 0.76389rem; } - -.status .status_icon { - display: inline-block; - width: 0.5rem; - height: 0.5rem; - margin-right: 0.25rem; } - .status .status_icon svg { - display: inline-block; - width: 0.5rem; - height: 0.5rem; } - .status .status_icon.-good svg circle { - fill: #3ec28f; } - .status .status_icon.-syncing svg circle { - fill: #DFCA29; } - .status .status_icon.-bad svg circle { - fill: #C2473E; } - -.status .status_text { - display: inline-block; } - -.header-nav { - display: flex; - justify-content: space-between; - padding: 1rem 0.5rem; - position: relative; - overflow: hidden; - height: 3.5rem; } - .header-nav .header-nav_left, .header-nav .header-nav_right { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; } - .header-nav .header-nav_title { - z-index: 2; - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; - padding: 1rem 0.5rem; - text-align: center; } - .header-nav .header-nav_title a, .header-nav .header-nav_title a:link, .header-nav .header-nav_title a:visited, .header-nav .header-nav_title h1 { - margin: -0.175rem 0 -0.175rem; - padding: 0.25rem 0.5rem 0.175rem; - display: inline-block; - font-size: 1rem; - line-height: 1.3rem; - color: rgba(34, 34, 34, 0.675); - font-weight: 500; } - .header-nav a, - .header-nav a:link, - .header-nav a:visited { - z-index: 9; - color: rgba(34, 34, 34, 0.675); - font-weight: 500; - display: block; - margin: -0.175rem 0 -0.175rem; - padding: 0.25rem 0.5rem 0.175rem; - border-radius: 0.25rem; } - .header-nav a:hover, - .header-nav a:link:hover, - .header-nav a:visited:hover { - background: rgba(221, 221, 221, 0.5); - color: #222; } - .header-nav a.icon, - .header-nav a:link.icon, - .header-nav a:visited.icon { - width: 1.8rem; - height: 1.8rem; - text-indent: -9999rem; - background-size: 1rem auto; - background-position: center center; - background-repeat: no-repeat; - opacity: 0.675; } - .header-nav a.icon:hover, - .header-nav a:link.icon:hover, - .header-nav a:visited.icon:hover { - opacity: 1; } - .header-nav a.icon.-receive, - .header-nav a:link.icon.-receive, - .header-nav a:visited.icon.-receive { - background-image: url("../assets/img/icons/receive.svg"); } - .header-nav a.icon.-settings, - .header-nav a:link.icon.-settings, - .header-nav a:visited.icon.-settings { - background-image: url("../assets/img/icons/gear.svg"); } - .header-nav a.icon.-back, - .header-nav a:link.icon.-back, - .header-nav a:visited.icon.-back { - background-image: url("../assets/img/icons/back.svg"); } - .header-nav a.icon.-close, - .header-nav a:link.icon.-close, - .header-nav a:visited.icon.-close { - background-image: url("../assets/img/icons/close.svg"); } - .header-nav a.icon.-new, - .header-nav a:link.icon.-new, - .header-nav a:visited.icon.-new { - background-image: url("../assets/img/icons/plus.svg"); } - -.footer-nav { - display: flex; - height: 3.5rem; - overflow: hidden; - justify-content: space-between; } - .footer-nav .footer-nav_status { - padding: 1rem; - font-size: 0.69444rem; - color: #888; } - .footer-nav .footer-nav_icons { - padding: 1rem; } - .footer-nav .footer-nav_option { - padding: 1rem; - width: 100%; - text-align: center; - font-size: 0.83333rem; - color: #888; } - .footer-nav .footer-nav_option button { - margin-left: 0.5rem; - display: inline-block; - padding: 0.125rem 0.5rem; } - .footer-nav a, - .footer-nav a:link, - .footer-nav a:visited { - display: block; - margin: -0.175rem 0 -0.175rem; - padding: 0.25rem 0.5rem 0.175rem; - border-radius: 0.25rem; } - .footer-nav a:hover, - .footer-nav a:link:hover, - .footer-nav a:visited:hover { - background: rgba(221, 221, 221, 0.5); - color: #222; } - .footer-nav a.icon, - .footer-nav a:link.icon, - .footer-nav a:visited.icon { - width: 1.8rem; - height: 1.8rem; - text-indent: -9999rem; - background-size: 1rem auto; - background-position: center center; - background-repeat: no-repeat; - opacity: 0.675; } - .footer-nav a.icon:hover, - .footer-nav a:link.icon:hover, - .footer-nav a:visited.icon:hover { - opacity: 1; } - .footer-nav a.icon.-receive, - .footer-nav a:link.icon.-receive, - .footer-nav a:visited.icon.-receive { - background-image: url("../assets/img/icons/receive.svg"); } - .footer-nav a.icon.-settings, - .footer-nav a:link.icon.-settings, - .footer-nav a:visited.icon.-settings { - background-image: url("../assets/img/icons/gear.svg"); } - -.progress-indicator { - display: flex; - width: 2.5rem; - height: 0.25rem; - overflow: hidden; - border-radius: 0.25rem; } - -.progress-indicator_step { - flex: 1; - background: #ddd; - height: 0.25rem; } - .progress-indicator_step.-complete { - background: #3ec28f; } - -.form-nav { - padding-top: 0.5rem; - display: flex; - justify-content: center; } - .form-nav.-binary { - justify-content: space-between; } - -.alert-screen { - height: 22rem; - display: flex; - align-items: center; - justify-content: center; } - .alert-screen .alert-screen_image { - display: flex; - align-items: center; - justify-content: center; } - .alert-screen .alert-screen_image img { - display: block; - width: 2rem; - height: auto; } - .alert-screen .alert-screen_text { - margin-top: 1rem; - text-align: center; } - .alert-screen .alert-screen_text h1, .alert-screen .alert-screen_text h2, .alert-screen .alert-screen_text big, .alert-screen .alert-screen_text strong { - font-weight: 600; - font-size: 1.2rem; - line-height: 1.56rem; - margin-bottom: 0.25rem; } - .alert-screen .alert-screen_text p { - color: #888; } - -.search-form { - display: flex; - justify-content: space-between; - padding: 0; - border-radius: 0.25rem; - background-color: #fff; - border: 0px solid #fff; - overflow: hidden; - box-shadow: 0 0.125rem 0.5rem rgba(34, 34, 34, 0.125); } - .search-form input[type='text'] { - border: 0; - background: transparent; - font-size: 0.83333rem; - font-weight: 400; - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - line-height: 1.3rem; - width: calc(100% - 2rem); - opacity: 0.75; - padding: 0.6rem 0.5rem 0.5rem; } - .search-form input[type='text']:focus { - opacity: 1; } - .search-form button { - width: 2.349375rem; - height: 2.349375rem; } diff --git a/packages/light-react/src/App/App.js b/packages/light-react/src/App/App.js index d519769601fe196535ffefc94f4edb72459a1e58..c1043dcdc744641d82ad22f3ea33597e8ab2d5bb 100644 --- a/packages/light-react/src/App/App.js +++ b/packages/light-react/src/App/App.js @@ -19,7 +19,6 @@ import Overlay from '../Overlay'; import Receive from '../Receive'; import Send from '../Send'; import Settings from '../Settings'; -import Signer from '../Send/Signer'; import { STATUS } from '../stores/healthStore'; import Tokens from '../Tokens'; import './App.css'; @@ -80,7 +79,6 @@ class App extends Component { - diff --git a/packages/light-react/src/Send/Send.js b/packages/light-react/src/Send/Send.js index e7f3c8acf712c79a96faf02970a7c8e6e7c6b4ae..b97e4471d65d93a5ab47a5ec6aa8e13b6f4906e5 100644 --- a/packages/light-react/src/Send/Send.js +++ b/packages/light-react/src/Send/Send.js @@ -3,130 +3,34 @@ // // SPDX-License-Identifier: MIT -import React, { PureComponent } from 'react'; -import { defaultAccount$, myBalance$ } from '@parity/light.js'; -import { map } from 'rxjs/operators'; -import { fromWei, toWei } from '@parity/api/lib/util/wei'; -import light from 'light-hoc'; -import { Link } from 'react-router-dom'; +import React, { Component } from 'react'; +import { inject, observer } from 'mobx-react'; +import { Route, Redirect, Switch } from 'react-router-dom'; -import ethereumIcon from '../assets/img/tokens/ethereum.png'; - -@light({ - balance: () => myBalance$().pipe(map(value => +fromWei(value))), - me: defaultAccount$ -}) -class Send extends PureComponent { - state = { - amount: 0.01, // In Ether - gas: 21000, - to: '0x00Ae02834e91810B223E54ce3f9B7875258a1747' - }; - - handleChangeAmount = ({ target: { value } }) => - this.setState({ amount: value }); - - handleChangeGas = ({ target: { value } }) => this.setState({ gas: value }); - - handleChangeTo = ({ target: { value } }) => this.setState({ to: value }); - - handleSubmit = e => { - e.preventDefault(); - const { history, me } = this.props; - const { amount, gas, to } = this.state; - const tx = { - from: me, - gas, - to, - value: toWei(amount) - }; - history.push(`/signer`, tx); - }; +import Sent from './Sent'; +import Signer from './Signer'; +import TxForm from './TxForm'; +@inject('sendStore') +@observer +class Send extends Component { render () { - const { balance } = this.props; - const { amount, gas, to } = this.state; + const { + sendStore: { token } + } = this.props; - return ( -
- + // We only show then Send components if we have already selected a token to + // send. + if (!token) { + return ; + } -
-
-
-
-
- ethereum -
-
Ethereum
-
- {balance} - ETH -
-
-
-
-
-
- - - -
-
- -