diff --git a/package.json b/package.json index 27191e391b3474f88fd5731e5b20f9a3efc26766..71d545db7b7dbaeee14dbc911481eac3ba1b201e 100644 --- a/package.json +++ b/package.json @@ -51,14 +51,15 @@ "mobx": "^4.2.0", "mobx-react": "^5.1.2", "react": "^16.3.2", + "react-blockies": "^1.3.0", "react-dom": "^16.3.2", "react-router-dom": "^4.2.2", "react-scripts": "1.1.4", + "rxjs": "^6.1.0", "yargs": "^11.0.0" }, "devDependencies": { "babel-eslint": "^8.2.3", - "case-sensitive-paths-webpack-plugin": "^2.1.2", "cross-env": "^5.1.4", "node-sass": "^4.9.0", "node-sass-chokidar": "^1.2.2", diff --git a/src/Accounts/Accounts.js b/src/Accounts/Accounts.js index ba164b9e39ccb3ac4f1ad8a69f51b081df9120c2..bb12defd1cd01e11d740982b0b8070399e4074c4 100644 --- a/src/Accounts/Accounts.js +++ b/src/Accounts/Accounts.js @@ -4,38 +4,51 @@ // SPDX-License-Identifier: MIT import React, { Component } from 'react'; -import { - allAccountsInfo$, - defaultAccount$, - setDefaultAccount$ -} from '@parity/light.js'; +import { allAccountsInfo$, setDefaultAccount$ } from '@parity/light.js'; +import Blockies from 'react-blockies'; import { Link } from 'react-router-dom'; import light from '../hoc'; @light({ - allAccountsInfo: allAccountsInfo$, - defaultAccount: defaultAccount$ + allAccountsInfo: allAccountsInfo$ }) class Accounts extends Component { - handleChange = ({ target: { value } }) => { - setDefaultAccount$(value); + componentWillUnmount () { + if (this.subscription) { + this.subscription.unsubscribe(); + } + } + + handleClick = ({ + currentTarget: { + dataset: { address } + } + }) => { + // Set default account to the clicked one, and go to Tokens on complete + this.subscription = setDefaultAccount$(address).subscribe(null, null, () => + this.props.history.push('/tokens') + ); }; render () { - const { allAccountsInfo, defaultAccount } = this.props; + const { allAccountsInfo } = this.props; return (
-

Current account:

{allAccountsInfo ? ( - + ) : (

Loading Accounts...

)} diff --git a/src/Accounts/CreateAccount/CreateAccountStep1/CreateAccountStep1.js b/src/Accounts/CreateAccount/CreateAccountStep1/CreateAccountStep1.js index 1e7a653bfab1d1ed2238134d8684515170139400..d5fb148e955e482f563b31c2fa85c0d0cf46cc18 100644 --- a/src/Accounts/CreateAccount/CreateAccountStep1/CreateAccountStep1.js +++ b/src/Accounts/CreateAccount/CreateAccountStep1/CreateAccountStep1.js @@ -4,6 +4,7 @@ // SPDX-License-Identifier: MIT import React, { Component } from 'react'; +import Blockie from 'react-blockies'; import { inject, observer } from 'mobx-react'; import { Link } from 'react-router-dom'; @@ -27,7 +28,9 @@ class CreateAccountStep1 extends Component {

Create account

- Your new address:
[BLOCKIE]
{address} 
+ Your new address:
+ +
{address} 
{pathname === '/accounts/new' && ( )} diff --git a/src/Accounts/CreateAccount/CreateAccountStep5/CreateAccountStep5.js b/src/Accounts/CreateAccount/CreateAccountStep5/CreateAccountStep5.js index 609f0254f50c4d7dbc1029024b232fa3f26b58ad..71e6366082842c1f29642b53796c241982f92ac1 100644 --- a/src/Accounts/CreateAccount/CreateAccountStep5/CreateAccountStep5.js +++ b/src/Accounts/CreateAccount/CreateAccountStep5/CreateAccountStep5.js @@ -14,7 +14,7 @@ class CreateAccountStep5 extends Component { createAccountStore: { saveAccountToParity }, history } = this.props; - saveAccountToParity().then(() => history.push('/settings')); + saveAccountToParity().then(() => history.push('/')); }; render () { diff --git a/src/App/App.js b/src/App/App.js index c6fc10984296ff4c2757b6ef655870608a0d5d0d..2d4843ec4af42855a08418ce1908cb5c2304a400 100644 --- a/src/App/App.js +++ b/src/App/App.js @@ -6,6 +6,7 @@ import React, { Component } from 'react'; import { BrowserRouter, MemoryRouter, Route, Link } from 'react-router-dom'; +import Accounts from '../Accounts'; import CreateAccount from '../Accounts/CreateAccount'; import Health from '../Health'; import Loading from '../Loading'; @@ -13,7 +14,7 @@ import ProtectedRoute from './ProtectedRoute'; import Receive from '../Receive'; import Send from '../Send'; import Settings from '../Settings'; -import Signer from '../Signer'; +import Signer from '../Send/Signer'; import Tokens from '../Tokens'; import './App.css'; @@ -35,17 +36,21 @@ class App extends Component {
- + + + - - +