Addresses as dapp

This commit is contained in:
Jaco Greeff 2017-04-24 12:20:12 +02:00
parent ec37cf6700
commit 3ce9071eb9
7 changed files with 84 additions and 21 deletions

View File

@ -1,4 +1,15 @@
[
{
"id": "addresses",
"url": "addresses",
"src": "Addresses",
"name": "Addresses",
"description": "Display the accounts added to the addressbook",
"author": "Parity Team <admin@ethcore.io>",
"version": "2.0.0",
"visible": true,
"secure": true
},
{
"id": "home",
"url": "home",

View File

@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import HistoryStore from '~/mobx/historyStore';
import { Accounts, Account, Addresses, Address, Application, Contract, Contracts, Dapp, Dapps, Signer, Wallet, Web, WriteContract } from '~/views';
import { Accounts, Account, Application, Contract, Contracts, Dapp, Dapps, Signer, Wallet, Web, WriteContract } from '~/views';
import builtinDapps from '~/config/dappsBuiltin.json';
import viewsDapps from '~/config/dappsViews.json';
@ -64,10 +64,6 @@ const accountsRoutes = [
}
];
const addressesRoutes = [
{ path: ':address', component: Address }
];
const contractsRoutes = [
{ path: 'develop', component: WriteContract },
{ path: ':address', component: Contract }
@ -76,7 +72,6 @@ const contractsRoutes = [
const routes = [
// Backward Compatible routes
{ path: '/account/:address', onEnter: handleDeprecatedRoute },
{ path: '/address/:address', onEnter: handleDeprecatedRoute },
{ path: '/contract/:address', onEnter: handleDeprecatedRoute },
{ path: '/', onEnter: redirectTo('/apps') },
@ -90,11 +85,6 @@ const childRoutes = [
indexRoute: { component: Accounts },
childRoutes: accountsRoutes
},
{
path: 'addresses',
indexRoute: { component: Addresses },
childRoutes: addressesRoutes
},
{
path: 'contracts',
indexRoute: { component: Contracts },

View File

@ -14,4 +14,34 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './addresses';
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 Addresses from './addresses';
import '~/../assets/fonts/Roboto/font.css';
import '~/../assets/fonts/RobotoMono/font.css';
import './addresses.css';
ContractInstances.get(api);
const store = initStore(api, hashHistory);
ReactDOM.render(
<ContextProvider api={ api } muiTheme={ muiTheme } store={ store }>
<Addresses />
</ContextProvider>,
document.querySelector('#container')
);

View File

@ -0,0 +1,19 @@
{
"name": "@parity/view-addresses",
"description": "Parity default addressbook view",
"version": "0.0.0",
"main": "index.js",
"author": "Parity Team <admin@parity.io>",
"maintainers": [],
"contributors": [],
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/paritytech/parity.git"
},
"keywords": [],
"scripts": {},
"devDependencies": {},
"dependencies": {},
"peerDependencies": {}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
const api = window.parent.secureApi;
export {
api
};

View File

@ -16,7 +16,7 @@
import React from 'react';
import { AccountsIcon, AddressesIcon, AppsIcon, ContactsIcon, FingerprintIcon } from '~/ui/Icons';
import { AccountsIcon, AppsIcon, ContactsIcon, FingerprintIcon } from '~/ui/Icons';
const defaultViews = {
accounts: {
@ -27,13 +27,6 @@ const defaultViews = {
value: 'account'
},
addresses: {
active: true,
icon: <AddressesIcon />,
route: '/addresses',
value: 'address'
},
apps: {
active: true,
icon: <AppsIcon />,

View File

@ -17,7 +17,6 @@
export Account from './Account';
export Accounts from './Accounts';
export Address from './Address';
export Addresses from './Addresses';
export Application from './Application';
export Contract from './Contract';
export Contracts from './Contracts';