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";
|
2019-09-02 14:50:01 +00:00
|
|
|
import PageNotFound from "./pages/common/PageNotFound";
|
|
|
|
|
import LoginPage from "./pages/common/LoginPage";
|
2019-03-16 11:33:15 +00:00
|
|
|
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-30 10:33:49 +00:00
|
|
|
import { appInitializer } from "./utils/AppsmithUtils";
|
2019-09-02 14:50:01 +00:00
|
|
|
import ProtectedRoute from "./pages/common/ProtectedRoute";
|
2019-01-21 15:11:10 +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-02-10 14:14:58 +00:00
|
|
|
<Provider store={store}>
|
2019-02-10 15:06:57 +00:00
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
|
<BrowserRouter>
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route exact path="/" component={App} />
|
2019-09-02 14:50:01 +00:00
|
|
|
<ProtectedRoute path="/builder" component={Editor} />
|
|
|
|
|
<Route exact path="/login" component={LoginPage} />
|
2019-02-10 15:06:57 +00:00
|
|
|
<Route component={PageNotFound} />
|
|
|
|
|
</Switch>
|
|
|
|
|
</BrowserRouter>
|
|
|
|
|
</ThemeProvider>
|
2019-02-10 14:14:58 +00:00
|
|
|
</Provider>,
|
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();
|