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";
|
|
|
|
|
import { createStore } from "redux";
|
|
|
|
|
import appReducer from "./reducers";
|
|
|
|
|
import WidgetBuilderRegistry from "./utils/WidgetRegistry";
|
|
|
|
|
import { ThemeProvider, theme } from "./constants/DefaultTheme";
|
2019-01-21 15:11:10 +00:00
|
|
|
|
2019-03-16 11:33:15 +00:00
|
|
|
WidgetBuilderRegistry.registerWidgetBuilders();
|
|
|
|
|
const store = createStore(appReducer);
|
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} />
|
|
|
|
|
<Route exact path="/builder" component={Editor} />
|
|
|
|
|
<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();
|