Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* tslint:disable */
- // @ts-ignore
- require("./images/fav");
- /* tslint:enable */
- import "./styles/style.scss";
- import * as React from "react";
- import * as ReactDOM from "react-dom";
- import { Route, Router, Switch } from "react-router-dom";
- import Form from "./components/views/Form";
- import Home from "./components/views/Home";
- import Room from "./components/views/Room";
- import History from "./history";
- import { ConnectedRouter } from "connected-react-router";
- import { Provider } from "react-redux";
- import store from "./store";
- /* tslint:disable */
- // @ts-ignore
- if (typeof window.ga !== "undefined") {
- History.listen((location) => {
- // @ts-ignore
- window.ga('set', 'page', location.pathname + location.search);
- // @ts-ignore
- window.ga('send', 'pageview');
- });
- }
- /* tslint:enable */
- class App extends React.Component<{}, {}> {
- public render() {
- return (
- <Provider store={store}>
- <ConnectedRouter history={History}>
- <Router history={History}>
- <Switch>
- <Route path="/" exact={true} component={Home}/>
- <Route path="/room/:id" exact={true} component={Room}/>
- <Route path="/submit" exact={true} component={Form}/>
- </Switch>
- </Router>
- </ConnectedRouter>
- </Provider>
- );
- }
- }
- const app: HTMLElement | null = document.getElementById("app");
- ReactDOM.render(
- <App />,
- app
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement