All files / javascripts/SqlLab index.jsx

0% Statements 0/18
100% Branches 0/0
100% Functions 0/0
0% Lines 0/18
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 31 32 33 34                                                                   
const $ = window.$ = require('jquery');
const jQuery = window.jQuery = $; // eslint-disable-line
require('bootstrap');
 
import React from 'react';
import { render } from 'react-dom';
import { getInitialState, sqlLabReducer } from './reducers';
import { initEnhancer } from '../reduxUtils';
import { createStore, compose, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import thunkMiddleware from 'redux-thunk';
 
import App from './components/App';
 
 
require('./main.css');
 
const appContainer = document.getElementById('app');
const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
const state = Object.assign({}, getInitialState(bootstrapData.defaultDbId), bootstrapData);
 
let store = createStore(
  sqlLabReducer, state, compose(applyMiddleware(thunkMiddleware), initEnhancer()));
 
// jquery hack to highlight the navbar menu
$('a:contains("SQL Lab")').parent().addClass('active');
 
render(
  <Provider store={store}>
    <App />
  </Provider>,
  appContainer
);