insomnia/app/index.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

import React from 'react';
2016-03-20 04:00:40 +00:00
import {render} from 'react-dom'
import {Provider} from 'react-redux'
import {Tabs} from 'react-tabs'
2016-04-23 06:16:23 +00:00
import createStore from './redux/create';
import App from './containers/App';
2016-03-20 04:00:40 +00:00
2016-03-18 06:30:48 +00:00
// Global CSS
2016-03-16 05:49:42 +00:00
import './css/index.scss'
2016-03-16 23:34:25 +00:00
import './css/lib/chrome/platform_app.css'
2016-03-16 05:49:42 +00:00
import './css/lib/fontawesome/css/font-awesome.css'
import {initStore} from './redux/initstore';
import {initDB} from './database';
2016-07-21 22:26:51 +00:00
import {getAppVersion} from './lib/appInfo';
import {initAnalytics} from './lib/analytics';
2016-03-16 05:49:42 +00:00
// Don't inject component styles (use our own)
Tabs.setUseDefaultStyles(false);
2016-04-16 23:24:57 +00:00
export const store = createStore();
2016-04-16 23:24:57 +00:00
2016-07-21 22:26:51 +00:00
console.log(`-- Loading App v${getAppVersion()} --`);
2016-04-16 23:24:57 +00:00
initDB()
.then(() => initStore(store.dispatch))
.then(() => initAnalytics()) // Must be after because we don't want to track the initial stuff
.then(() => {
console.log('-- Rendering App --');
render(
<Provider store={store}><App /></Provider>,
document.getElementById('root')
);
})
.catch(err => {
console.error('Failed to initialize app', err);
2016-04-16 23:24:57 +00:00
});