diff --git a/js/src/config/dappsViews.json b/js/src/config/dappsViews.json index 199faeb2f..07477c7ac 100644 --- a/js/src/config/dappsViews.json +++ b/js/src/config/dappsViews.json @@ -1,4 +1,15 @@ [ + { + "id": "accounts", + "url": "accounts", + "src": "Accounts", + "name": "Accounts", + "description": "Display the accounts", + "author": "Parity Team ", + "version": "2.0.0", + "visible": true, + "secure": true + }, { "id": "addresses", "url": "addresses", diff --git a/js/src/routes.js b/js/src/routes.js index 018e0299d..899ab789b 100644 --- a/js/src/routes.js +++ b/js/src/routes.js @@ -15,13 +15,13 @@ // along with Parity. If not, see . import HistoryStore from '~/mobx/historyStore'; -import { Accounts, Account, Application, Contract, Contracts, Dapp, Dapps, Signer, Wallet, Web, WriteContract } from '~/views'; +import { Application, Contract, Contracts, Dapp, Dapps, Signer, Web, WriteContract } from '~/views'; import builtinDapps from '~/config/dappsBuiltin.json'; import viewsDapps from '~/config/dappsViews.json'; const dapps = [].concat(viewsDapps, builtinDapps); -const accountsHistory = HistoryStore.get('accounts'); +// const accountsHistory = HistoryStore.get('accounts'); const dappsHistory = HistoryStore.get('dapps'); function handleDeprecatedRoute (nextState, replace) { @@ -47,22 +47,22 @@ function redirectTo (path) { }; } -const accountsRoutes = [ - { - path: ':address', - component: Account, - onEnter: ({ params }) => { - accountsHistory.add(params.address, 'account'); - } - }, - { - path: '/wallet/:address', - component: Wallet, - onEnter: ({ params }) => { - accountsHistory.add(params.address, 'wallet'); - } - } -]; +// const accountsRoutes = [ +// { +// path: ':address', +// component: Account, +// onEnter: ({ params }) => { +// accountsHistory.add(params.address, 'account'); +// } +// }, +// { +// path: '/wallet/:address', +// component: Wallet, +// onEnter: ({ params }) => { +// accountsHistory.add(params.address, 'wallet'); +// } +// } +// ]; const contractsRoutes = [ { path: 'develop', component: WriteContract }, @@ -71,7 +71,6 @@ const contractsRoutes = [ const routes = [ // Backward Compatible routes - { path: '/account/:address', onEnter: handleDeprecatedRoute }, { path: '/contract/:address', onEnter: handleDeprecatedRoute }, { path: '/', onEnter: redirectTo('/apps') }, @@ -80,11 +79,6 @@ const routes = [ ]; const childRoutes = [ - { - path: 'accounts', - indexRoute: { component: Accounts }, - childRoutes: accountsRoutes - }, { path: 'contracts', indexRoute: { component: Contracts }, diff --git a/js/src/views/Accounts/index.js b/js/src/views/Accounts/index.js index 027387e70..4bd637d91 100644 --- a/js/src/views/Accounts/index.js +++ b/js/src/views/Accounts/index.js @@ -14,4 +14,32 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -export default from './accounts'; +import ReactDOM from 'react-dom'; +import React from 'react'; +import { hashHistory } from 'react-router'; + +import injectTapEventPlugin from 'react-tap-event-plugin'; +injectTapEventPlugin(); + +import { api } from './parity'; + +import ContractInstances from '~/contracts'; +import { initStore } from '~/redux'; +import ContextProvider from '~/ui/ContextProvider'; +import muiTheme from '~/ui/Theme'; + +import Accounts from './accounts'; + +import '~/../assets/fonts/Roboto/font.css'; +import '~/../assets/fonts/RobotoMono/font.css'; + +ContractInstances.get(api); + +const store = initStore(api, hashHistory); + +ReactDOM.render( + + + , + document.querySelector('#container') +); diff --git a/js/src/views/Accounts/package.json b/js/src/views/Accounts/package.json new file mode 100644 index 000000000..022919800 --- /dev/null +++ b/js/src/views/Accounts/package.json @@ -0,0 +1,19 @@ +{ + "name": "@parity/view-addresses", + "description": "Parity default addressbook view", + "version": "0.0.0", + "main": "index.js", + "author": "Parity Team ", + "maintainers": [], + "contributors": [], + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/paritytech/parity.git" + }, + "keywords": [], + "scripts": {}, + "devDependencies": {}, + "dependencies": {}, + "peerDependencies": {} +} diff --git a/js/src/views/Accounts/parity.js b/js/src/views/Accounts/parity.js new file mode 100644 index 000000000..7118ce087 --- /dev/null +++ b/js/src/views/Accounts/parity.js @@ -0,0 +1,21 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +const api = window.parent.secureApi; + +export { + api +}; diff --git a/js/src/views/Settings/Views/defaults.js b/js/src/views/Settings/Views/defaults.js index 11ce6c706..a74de012d 100644 --- a/js/src/views/Settings/Views/defaults.js +++ b/js/src/views/Settings/Views/defaults.js @@ -16,17 +16,9 @@ import React from 'react'; -import { AccountsIcon, AppsIcon, ContactsIcon, FingerprintIcon } from '~/ui/Icons'; +import { AppsIcon, ContactsIcon, FingerprintIcon } from '~/ui/Icons'; const defaultViews = { - accounts: { - active: true, - fixed: true, - icon: , - route: '/accounts', - value: 'account' - }, - apps: { active: true, icon: , diff --git a/js/src/views/index.js b/js/src/views/index.js index 16bbd1514..43dd25c31 100644 --- a/js/src/views/index.js +++ b/js/src/views/index.js @@ -15,7 +15,6 @@ // along with Parity. If not, see . export Account from './Account'; -export Accounts from './Accounts'; export Address from './Address'; export Application from './Application'; export Contract from './Contract';