diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-10 20:40:54 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-10 20:40:54 +0000 |
| commit | 6fe70786242de8aae0d592f658ace0624a369685 (patch) | |
| tree | ac92d603a2bf72c94d5082f52ddedf4b3177b703 /app/app.js | |
| parent | 036da86805c8c09edabeb116ad2d682e061a6e60 (diff) | |
| download | mullvadvpn-6fe70786242de8aae0d592f658ace0624a369685.tar.xz mullvadvpn-6fe70786242de8aae0d592f658ace0624a369685.zip | |
Add backend mockup and wire it up with all components
Diffstat (limited to 'app/app.js')
| -rw-r--r-- | app/app.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/app.js b/app/app.js index d92e5e8fa8..4b85a79ffd 100644 --- a/app/app.js +++ b/app/app.js @@ -8,6 +8,9 @@ import path from 'path'; import routes from './routes'; import configureStore from './store'; import Tray from './containers/Tray'; +import Backend from './lib/backend'; + +const backend = new Backend(); const iconPath = path.join(__dirname, 'assets/images/trayicon.png'); const tray = new remote.Tray(iconPath); @@ -20,10 +23,18 @@ const rootElement = document.querySelector(document.currentScript.getAttribute(' // disable smart pinch. webFrame.setVisualZoomLevelLimits(1, 1); +// helper method for router to pass backend down the component tree +const createElement = (Component, props) => { + const newProps = { ...props, backend }; + return ( + <Component {...newProps} /> + ); +}; + ReactDOM.render( <div> <Provider store={store}> - <Router history={routerHistory} routes={routes} /> + <Router history={routerHistory} routes={routes} createElement={createElement} /> </Provider> <Provider store={store}> <Tray handle={tray} history={routerHistory} /> |
