Raygun.tsx

import * as React from "react"; import { withRouter } from "react-router"; import { Switch, Route } from "react-router-dom"; import rg4js from "raygun4js"; import { AuthProvider, CallbackPage, LogoutPage } from "shared/react-auth0-web"; import config from "./config"; import { Login, InstallPixel, Confirm, Dashboard } from "./dealmaker/containers"; rg4js("enableCrashReporting", true); rg4js("apiKey", "nzQhPRPCpl6gKjbSFgrYoA=="); rg4js("enablePulse", true); class Raygun extends React.Component<any, any> { constructor(props: any) { super(props); // The listener this.props.history.listen((location, action) => { rg4js("trackEvent", { type: "pageView", path: location.pathname }); }); } render() { return ( <AuthProvider config={config.auth}> <Switch> <Route exact path="/callback" component={CallbackPage} /> <Route exact path="/sign-out" component={LogoutPage} /> <Route path="/login" render={p => <Login {...p} />} /> <Route path="/o-install" render={p => <InstallPixel {...p} />} /> <Route path="/o-confirm" component={Confirm} /> <Route render={p => <Dashboard {...p} />} /> </Switch> </AuthProvider> ); } } export default withRouter(Raygun);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.