2019-03-16 11:33:15 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import ReactDOM from "react-dom";
|
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
|
import "./index.css";
|
|
|
|
|
import App from "./App";
|
|
|
|
|
import Editor from "./pages/Editor";
|
|
|
|
|
import PageNotFound from "./pages/PageNotFound";
|
|
|
|
|
import * as serviceWorker from "./serviceWorker";
|
|
|
|
|
import { BrowserRouter, Route, Switch } from "react-router-dom";
|
2019-03-26 15:28:24 +00:00
|
|
|
import { createStore, applyMiddleware } from "redux";
|
2019-03-16 11:33:15 +00:00
|
|
|
import appReducer from "./reducers";
|
|
|
|
|
import WidgetBuilderRegistry from "./utils/WidgetRegistry";
|
|
|
|
|
import { ThemeProvider, theme } from "./constants/DefaultTheme";
|
2019-03-26 15:28:24 +00:00
|
|
|
import createSagaMiddleware from 'redux-saga'
|
|
|
|
|
import { rootSaga } from "./sagas"
|
2019-08-29 11:22:09 +00:00
|
|
|
// import { ActionType, ReduxAction } from "./constants/ActionConstants";
|
2019-01-21 15:11:10 +00:00
|
|
|
|
2019-08-26 12:41:21 +00:00
|
|
|
import { DndProvider } from "react-dnd"
|
2019-04-01 07:08:00 +00:00
|
|
|
import HTML5Backend from "react-dnd-html5-backend"
|
2019-08-30 10:33:49 +00:00
|
|
|
import { appInitializer } from "./utils/AppsmithUtils";
|
2019-04-01 07:08:00 +00:00
|
|
|
|
2019-08-30 10:33:49 +00:00
|
|
|
appInitializer()
|
2019-03-16 11:33:15 +00:00
|
|
|
WidgetBuilderRegistry.registerWidgetBuilders();
|
2019-03-26 15:28:24 +00:00
|
|
|
const sagaMiddleware = createSagaMiddleware()
|
|
|
|
|
const store = createStore(appReducer, applyMiddleware(sagaMiddleware));
|
|
|
|
|
sagaMiddleware.run(rootSaga)
|
2019-02-07 05:07:09 +00:00
|
|
|
ReactDOM.render(
|
2019-04-01 07:08:00 +00:00
|
|
|
|
2019-08-26 12:41:21 +00:00
|
|
|
<DndProvider backend={HTML5Backend}>
|
|
|
|
|
<Provider store={store}>
|
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
|
<BrowserRouter>
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route exact path="/" component={App} />
|
|
|
|
|
<Route exact path="/builder" component={Editor} />
|
|
|
|
|
<Route component={PageNotFound} />
|
|
|
|
|
</Switch>
|
|
|
|
|
</BrowserRouter>
|
|
|
|
|
</ThemeProvider>
|
|
|
|
|
</Provider>
|
|
|
|
|
</DndProvider>,
|
2019-02-07 05:07:09 +00:00
|
|
|
document.getElementById("root")
|
2019-03-16 11:33:15 +00:00
|
|
|
);
|
2019-01-21 15:11:10 +00:00
|
|
|
|
|
|
|
|
// If you want your app to work offline and load faster, you can change
|
|
|
|
|
// unregister() to register() below. Note this comes with some pitfalls.
|
|
|
|
|
// Learn more about service workers: http://bit.ly/CRA-PWA
|
2019-03-16 11:33:15 +00:00
|
|
|
serviceWorker.unregister();
|