diff --git a/js/src/config/dappsViews.json b/js/src/config/dappsViews.json index a273a70f9..8fcc06d30 100644 --- a/js/src/config/dappsViews.json +++ b/js/src/config/dappsViews.json @@ -33,6 +33,18 @@ "visible": true, "secure": true }, + { + "id": "address", + "url": "address", + "src": "Address", + "name": "Address", + "description": "Display a single address", + "author": "Parity Team ", + "version": "2.0.0", + "visible": true, + "secure": true, + "noselect": true + }, { "id": "contracts", "url": "contracts", @@ -44,6 +56,18 @@ "visible": true, "secure": true }, + { + "id": "contract", + "url": "contract", + "src": "Contract", + "name": "Contract", + "description": "Display a single contract", + "author": "Parity Team ", + "version": "2.0.0", + "visible": true, + "secure": true, + "noselect": true + }, { "id": "develop", "url": "develop", @@ -109,5 +133,17 @@ "version": "2.0.0", "visible": true, "secure": true + }, + { + "id": "wallet", + "url": "wallet", + "src": "Wallet", + "name": "Wallet", + "description": "Display a single wallet account", + "author": "Parity Team ", + "version": "2.0.0", + "visible": true, + "secure": true, + "noselect": true } ] diff --git a/js/src/routes.js b/js/src/routes.js index d6c009a18..742424497 100644 --- a/js/src/routes.js +++ b/js/src/routes.js @@ -30,27 +30,6 @@ 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 contractsRoutes = [ -// { path: ':address', component: Contract } -// ]; - const routes = [ { path: '/', onEnter: redirectTo('/apps') }, { path: '/auth', onEnter: redirectTo('/apps') } diff --git a/js/src/views/Account/account.js b/js/src/views/Account/account.js index 262d3950d..d7d133aca 100644 --- a/js/src/views/Account/account.js +++ b/js/src/views/Account/account.js @@ -22,6 +22,7 @@ import { bindActionCreators } from 'redux'; import shapeshiftBtn from '~/../assets/images/shapeshift-btn.png'; import HardwareStore from '~/mobx/hardwareStore'; +import HistoryStore from '~/mobx/historyStore'; import { DeleteAccount, EditMeta, Faucet, PasswordManager, Shapeshift, Transfer, Verification } from '~/modals'; import { setVisibleAccounts } from '~/redux/providers/personalActions'; import { fetchCertifiers, fetchCertifications } from '~/redux/providers/certifications/actions'; @@ -35,6 +36,8 @@ import Store from './store'; import Transactions from './Transactions'; import styles from './account.css'; +const accountsHistory = HistoryStore.get('accounts'); + @observer class Account extends Component { static contextTypes = { @@ -56,7 +59,11 @@ class Account extends Component { hwstore = HardwareStore.get(this.context.api); componentDidMount () { - console.log('Account', 'componentDidMount'); + const { params } = this.props; + + if (params.address) { + accountsHistory.add(params.address, 'wallet'); + } this.props.fetchCertifiers(); this.setVisibleAccounts(); diff --git a/js/src/views/Account/index.js b/js/src/views/Account/index.js index febb9c5bb..207168954 100644 --- a/js/src/views/Account/index.js +++ b/js/src/views/Account/index.js @@ -40,7 +40,7 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + , document.querySelector('#container') diff --git a/js/src/views/Account/package.json b/js/src/views/Account/package.json index 31c3aae0d..c76a62759 100644 --- a/js/src/views/Account/package.json +++ b/js/src/views/Account/package.json @@ -1,5 +1,5 @@ { - "name": "@parity/view-address", + "name": "@parity/view-account", "description": "Parity default account view", "version": "0.0.0", "main": "index.js", diff --git a/js/src/views/Address/index.js b/js/src/views/Address/index.js index 49bf1c2cd..94252425a 100644 --- a/js/src/views/Address/index.js +++ b/js/src/views/Address/index.js @@ -14,4 +14,34 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -export default from './address'; +import ReactDOM from 'react-dom'; +import React from 'react'; +import { Route, Router, 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 Address from './address'; + +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/Address/package.json b/js/src/views/Address/package.json new file mode 100644 index 000000000..48677fcd2 --- /dev/null +++ b/js/src/views/Address/package.json @@ -0,0 +1,19 @@ +{ + "name": "@parity/view-address", + "description": "Parity default address 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/Address/parity.js b/js/src/views/Address/parity.js new file mode 100644 index 000000000..7118ce087 --- /dev/null +++ b/js/src/views/Address/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/Addresses/addresses.js b/js/src/views/Addresses/addresses.js index 41487e5b0..f4324703d 100644 --- a/js/src/views/Addresses/addresses.js +++ b/js/src/views/Addresses/addresses.js @@ -90,7 +90,7 @@ class Addresses extends Component { return ( . -export default from './contract'; +import ReactDOM from 'react-dom'; +import React from 'react'; +import { Route, Router, 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 Contract from './contract'; + +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/Contract/package.json b/js/src/views/Contract/package.json new file mode 100644 index 000000000..48677fcd2 --- /dev/null +++ b/js/src/views/Contract/package.json @@ -0,0 +1,19 @@ +{ + "name": "@parity/view-address", + "description": "Parity default address 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/Contract/parity.js b/js/src/views/Contract/parity.js new file mode 100644 index 000000000..7118ce087 --- /dev/null +++ b/js/src/views/Contract/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/Contracts/contracts.js b/js/src/views/Contracts/contracts.js index f6a72bb21..6bbc8e5aa 100644 --- a/js/src/views/Contracts/contracts.js +++ b/js/src/views/Contracts/contracts.js @@ -104,7 +104,7 @@ class Contracts extends Component { { this.renderDeployContract() } ); } diff --git a/js/src/views/Wallet/index.js b/js/src/views/Wallet/index.js index 312536f5b..7a22f3637 100644 --- a/js/src/views/Wallet/index.js +++ b/js/src/views/Wallet/index.js @@ -14,4 +14,34 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -export default from './wallet'; +import ReactDOM from 'react-dom'; +import React from 'react'; +import { Route, Router, 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 Wallet from './wallet'; + +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/Wallet/package.json b/js/src/views/Wallet/package.json new file mode 100644 index 000000000..8eb7c9dbe --- /dev/null +++ b/js/src/views/Wallet/package.json @@ -0,0 +1,19 @@ +{ + "name": "@parity/view-wallet", + "description": "Parity default wallet 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/Wallet/parity.js b/js/src/views/Wallet/parity.js new file mode 100644 index 000000000..7118ce087 --- /dev/null +++ b/js/src/views/Wallet/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/Wallet/wallet.js b/js/src/views/Wallet/wallet.js index e996e5fdc..7db60ec59 100644 --- a/js/src/views/Wallet/wallet.js +++ b/js/src/views/Wallet/wallet.js @@ -20,6 +20,7 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import moment from 'moment'; +import HistoryStore from '~/mobx/historyStore'; import { EditMeta, Transfer, WalletSettings } from '~/modals'; import { Actionbar, Button, Page, Loading } from '~/ui'; import { DeleteIcon, EditIcon, SendIcon, SettingsIcon } from '~/ui/Icons'; @@ -35,6 +36,8 @@ import { setVisibleAccounts } from '~/redux/providers/personalActions'; import styles from './wallet.css'; +const accountsHistory = HistoryStore.get('accounts'); + class WalletContainer extends Component { static propTypes = { netVersion: PropTypes.string.isRequired @@ -80,6 +83,10 @@ class Wallet extends Component { }; componentDidMount () { + const { address } = this.props; + + accountsHistory.add(address, 'wallet'); + this.setVisibleAccounts(); } diff --git a/js/src/views/index.js b/js/src/views/index.js index daf2ac46b..74c75c23a 100644 --- a/js/src/views/index.js +++ b/js/src/views/index.js @@ -14,11 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -export Address from './Address'; export Application from './Application'; -export Contract from './Contract'; export Dapp from './Dapp'; export Dapps from './Dapps'; export ParityBar from './ParityBar'; -export Wallet from './Wallet'; export Web from './Web';