fediverse.space/frontend/src/index.tsx

49 wiersze
1.6 KiB
TypeScript
Czysty Zwykły widok Historia

import "../node_modules/@blueprintjs/core/lib/css/blueprint.css";
import "../node_modules/@blueprintjs/icons/lib/css/blueprint-icons.css";
import "../node_modules/@blueprintjs/select/lib/css/blueprint-select.css";
import "../node_modules/normalize.css/normalize.css";
import "./index.css";
2018-08-27 15:27:09 +00:00
import cytoscape from "cytoscape";
import popper from "cytoscape-popper";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { applyMiddleware, compose, createStore } from "redux";
import thunk from "redux-thunk";
2018-08-27 15:27:09 +00:00
import { FocusStyleManager } from "@blueprintjs/core";
2018-08-27 15:27:09 +00:00
import { routerMiddleware } from "connected-react-router";
import { createBrowserHistory } from "history";
2019-07-23 16:32:43 +00:00
import AppRouter from "./AppRouter";
import createRootReducer from "./redux/reducers";
2018-08-27 12:07:32 +00:00
2018-08-27 15:27:09 +00:00
// https://blueprintjs.com/docs/#core/accessibility.focus-management
FocusStyleManager.onlyShowFocusOnTabs();
export const history = createBrowserHistory();
2018-08-27 15:27:09 +00:00
// Initialize redux
2020-05-19 13:45:27 +00:00
const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
createRootReducer(history),
composeEnhancers(applyMiddleware(routerMiddleware(history), thunk))
);
// Initialize cytoscape plugins
cytoscape.use(popper as any);
2018-08-27 15:27:09 +00:00
2018-08-27 12:07:32 +00:00
ReactDOM.render(
2018-08-27 15:27:09 +00:00
<Provider store={store}>
<AppRouter />
2018-08-27 15:27:09 +00:00
</Provider>,
document.getElementById("root") as HTMLElement
2018-08-27 12:07:32 +00:00
);
2019-07-20 18:08:56 +00:00
// if (process.env.NODE_ENV !== "production") {
// // tslint:disable-next-line:no-var-requires
// const axe = require("react-axe");
// axe(React, ReactDOM, 5000);
// }