diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-06 19:20:02 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-06 19:20:02 +0000 |
| commit | 9ac8cfb03f478fa3ef3c51ff2e1e0a8274d0e26b (patch) | |
| tree | c798ad0feb5211663bb40a909f336c417f1e1e3e /app/app.js | |
| parent | 409b633f23c3a96db4c5c363a15b3dc2bc815441 (diff) | |
| download | mullvadvpn-9ac8cfb03f478fa3ef3c51ff2e1e0a8274d0e26b.tar.xz mullvadvpn-9ac8cfb03f478fa3ef3c51ff2e1e0a8274d0e26b.zip | |
Add declarative Tray implementation
Diffstat (limited to 'app/app.js')
| -rw-r--r-- | app/app.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/app.js b/app/app.js index 101014e9b1..eb71a8201b 100644 --- a/app/app.js +++ b/app/app.js @@ -3,18 +3,28 @@ import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { Router, hashHistory } from 'react-router'; import { syncHistoryWithStore } from 'react-router-redux'; +import { remote } from 'electron'; +import path from 'path'; import routes from './routes'; import configureStore from './store'; +import Tray from './containers/Tray'; + +const iconPath = path.join(__dirname, 'assets/trayicon.png'); +const tray = new remote.Tray(iconPath); const initialState = {}; const store = configureStore(initialState); const routerHistory = syncHistoryWithStore(hashHistory, store); - const rootElement = document.querySelector(document.currentScript.getAttribute('data-container')); ReactDOM.render( - <Provider store={store}> - <Router history={routerHistory} routes={routes} /> - </Provider>, + <div> + <Provider store={store}> + <Router history={routerHistory} routes={routes} /> + </Provider> + <Provider store={store}> + <Tray handle={tray} history={routerHistory} /> + </Provider> + </div>, rootElement ); |
