From 2e1b05940f3cd5091ed26a2b1633c29d09df9c69 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 24 Apr 2017 15:37:53 +0200 Subject: [PATCH] Router/Route usage consistency between dapps --- js/src/views/Accounts/index.js | 6 ++-- js/src/views/Addresses/index.js | 6 ++-- js/src/views/ContractDevelop/index.js | 6 ++-- js/src/views/Contracts/index.js | 6 ++-- js/src/views/Home/index.js | 6 ++-- js/src/views/Settings/index.js | 30 ++++++++++++------- js/src/views/Settings/main.js | 42 --------------------------- js/src/views/Signer/index.js | 6 ++-- js/src/views/Status/index.js | 6 ++-- js/src/views/Vaults/index.js | 6 ++-- 10 files changed, 52 insertions(+), 68 deletions(-) delete mode 100644 js/src/views/Settings/main.js diff --git a/js/src/views/Accounts/index.js b/js/src/views/Accounts/index.js index 4bd637d91..8586680f3 100644 --- a/js/src/views/Accounts/index.js +++ b/js/src/views/Accounts/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -39,7 +39,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/Addresses/index.js b/js/src/views/Addresses/index.js index 82560f2be..1188498d1 100644 --- a/js/src/views/Addresses/index.js +++ b/js/src/views/Addresses/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -41,7 +41,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/ContractDevelop/index.js b/js/src/views/ContractDevelop/index.js index aef47fecc..c1ffc17d2 100644 --- a/js/src/views/ContractDevelop/index.js +++ b/js/src/views/ContractDevelop/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -38,7 +38,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/Contracts/index.js b/js/src/views/Contracts/index.js index b150eecb3..e6cd95c90 100644 --- a/js/src/views/Contracts/index.js +++ b/js/src/views/Contracts/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -39,7 +39,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/Home/index.js b/js/src/views/Home/index.js index aed8a06e4..6f6a064dd 100644 --- a/js/src/views/Home/index.js +++ b/js/src/views/Home/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -38,7 +38,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/Settings/index.js b/js/src/views/Settings/index.js index 27de8f5c6..0f4289786 100644 --- a/js/src/views/Settings/index.js +++ b/js/src/views/Settings/index.js @@ -21,26 +21,36 @@ import { IndexRedirect, Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); +import { initStore } from '~/redux'; +import ContextProvider from '~/ui/ContextProvider'; +import muiTheme from '~/ui/Theme'; + +import { api } from './parity'; + import SettingsBackground from './Background'; import SettingsParity from './Node'; import SettingsProxy from './Proxy'; import SettingsViews from './Views'; -import Main from './main'; +import Settings from './settings'; import '~/../assets/fonts/Roboto/font.css'; import '~/../assets/fonts/RobotoMono/font.css'; import './settings.css'; +const store = initStore(api, hashHistory); + ReactDOM.render( - - - - - - - - - , + + + + + + + + + + + , document.querySelector('#container') ); diff --git a/js/src/views/Settings/main.js b/js/src/views/Settings/main.js deleted file mode 100644 index edee56e87..000000000 --- a/js/src/views/Settings/main.js +++ /dev/null @@ -1,42 +0,0 @@ -// 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 . - -import React, { PropTypes } from 'react'; -import { hashHistory } from 'react-router'; - -import { api } from './parity'; - -import { initStore } from '~/redux'; -import ContextProvider from '~/ui/ContextProvider'; -import muiTheme from '~/ui/Theme'; - -import Settings from './settings'; - -const store = initStore(api, hashHistory); - -export default function Main ({ children }) { - return ( - - - { children } - - - ); -} - -Main.propTypes = { - children: PropTypes.node -}; diff --git a/js/src/views/Signer/index.js b/js/src/views/Signer/index.js index 914c86eb7..ad6a49503 100644 --- a/js/src/views/Signer/index.js +++ b/js/src/views/Signer/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -39,7 +39,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/Status/index.js b/js/src/views/Status/index.js index 371c9687b..cf362c6aa 100644 --- a/js/src/views/Status/index.js +++ b/js/src/views/Status/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -41,7 +41,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') ); diff --git a/js/src/views/Vaults/index.js b/js/src/views/Vaults/index.js index 3085990e8..614323185 100644 --- a/js/src/views/Vaults/index.js +++ b/js/src/views/Vaults/index.js @@ -16,7 +16,7 @@ import ReactDOM from 'react-dom'; import React from 'react'; -import { hashHistory } from 'react-router'; +import { Route, Router, hashHistory } from 'react-router'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); @@ -41,7 +41,9 @@ const store = initStore(api, hashHistory); ReactDOM.render( - + + + , document.querySelector('#container') );