insomnia/app/ui/index.js
Gregory Schier e2c72987e8 Autocomplete for variables and tags (#112)
* Fixed duplication kve bug

* Autocomplete sort of works now

* Even better

* Styled autocomplete dropdown

* Minor tweaks

* Autocomplete looking pretty spiffy

* Bug fixes

* Apply dropdown to all editors

* Fixed key propagation when autocomplete open

* Fixed some modals

* Split up editor less

* Some css improvements

* Move filter help out of editor

* Fixed drag-n-drop

* Perfected autocomplete theme

* "fixed" one-line-editor hint click bug

* Better autocomplete and switch single line input on drag enter

* Don't autocomplete on Tab

* Better tag dnd

* Add constants completion API

* Autocomplete headers

* Fixed tests
2017-03-11 16:31:23 -08:00

52 lines
1.4 KiB
JavaScript

import React from 'react';
import ReactDOM from 'react-dom';
import {AppContainer} from 'react-hot-loader';
import {Provider} from 'react-redux';
import {Tabs} from 'react-tabs';
import {DragDropContext} from 'react-dnd';
import App from './containers/app';
import {init as initStore} from './redux/modules';
import {init as initDB} from '../common/database';
import {init as initSync} from '../sync';
import {init as initAnalytics} from '../analytics';
import {types as modelTypes} from '../models';
import {getAccountId} from '../sync/session';
import DNDBackend from './dnd-backend';
import './css/index.less';
// Don't inject component styles (use our own)
Tabs.setUseDefaultStyles(false);
(async function () {
await initDB(modelTypes());
await initAnalytics(getAccountId());
// Create Redux store
const store = await initStore();
const context = DragDropContext(DNDBackend);
const DndComponent = context(App);
const render = Component => {
ReactDOM.render(
<AppContainer>
<Provider store={store}>
<Component/>
</Provider>
</AppContainer>,
document.getElementById('root')
);
};
render(DndComponent);
// Hot Module Replacement API
if (module.hot) {
module.hot.accept('./containers/app', () => {
render(DndComponent);
});
}
// Do things that can wait
process.nextTick(initSync);
})();