summaryrefslogtreecommitdiffhomepage
path: root/app/app.js
blob: 69c74398cd380ac745b88fbea2791ea7c7ae0be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
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/images/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(
  <div>
    <Provider store={store}>
      <Router history={routerHistory} routes={routes} />
    </Provider>
    <Provider store={store}>
      <Tray handle={tray} history={routerHistory} />
    </Provider>
  </div>,
  rootElement
);