2021-07-16 21:38:44 +00:00
|
|
|
/*
|
|
|
|
Copyright 2021 New Vector Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-01-05 23:06:51 +00:00
|
|
|
import React from "react";
|
|
|
|
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
|
2021-10-06 18:38:26 +00:00
|
|
|
import * as Sentry from "@sentry/react";
|
2021-12-09 20:58:30 +00:00
|
|
|
import { OverlayProvider } from "@react-aria/overlays";
|
2022-01-05 01:09:27 +00:00
|
|
|
import { HomePage } from "./home/HomePage";
|
2022-01-06 00:34:01 +00:00
|
|
|
import { LoginPage } from "./auth/LoginPage";
|
|
|
|
import { RegisterPage } from "./auth/RegisterPage";
|
2022-01-05 23:06:51 +00:00
|
|
|
import { RoomPage } from "./room/RoomPage";
|
|
|
|
import { RoomRedirect } from "./room/RoomRedirect";
|
2022-01-06 01:19:03 +00:00
|
|
|
import { ClientProvider } from "./ClientContext";
|
2021-12-23 22:40:23 +00:00
|
|
|
import { usePageFocusStyle } from "./usePageFocusStyle";
|
2022-02-01 23:11:06 +00:00
|
|
|
import { SequenceDiagramViewerPage } from "./SequenceDiagramViewerPage";
|
2022-01-05 23:06:51 +00:00
|
|
|
|
2021-10-06 18:38:26 +00:00
|
|
|
const SentryRoute = Sentry.withSentryRouting(Route);
|
|
|
|
|
2021-12-18 00:30:10 +00:00
|
|
|
export default function App({ history }) {
|
2021-12-23 22:40:23 +00:00
|
|
|
usePageFocusStyle();
|
2021-12-10 21:06:16 +00:00
|
|
|
|
2021-07-16 21:22:03 +00:00
|
|
|
return (
|
2021-12-18 00:30:10 +00:00
|
|
|
<Router history={history}>
|
|
|
|
<ClientProvider>
|
2021-12-09 20:58:30 +00:00
|
|
|
<OverlayProvider>
|
2021-12-04 00:42:29 +00:00
|
|
|
<Switch>
|
2021-12-09 20:58:30 +00:00
|
|
|
<SentryRoute exact path="/">
|
2022-01-05 01:09:27 +00:00
|
|
|
<HomePage />
|
2021-12-09 20:58:30 +00:00
|
|
|
</SentryRoute>
|
2021-12-04 00:42:29 +00:00
|
|
|
<SentryRoute exact path="/login">
|
2021-12-09 20:58:30 +00:00
|
|
|
<LoginPage />
|
2021-12-04 00:42:29 +00:00
|
|
|
</SentryRoute>
|
|
|
|
<SentryRoute exact path="/register">
|
2021-12-09 20:58:30 +00:00
|
|
|
<RegisterPage />
|
2021-12-04 00:42:29 +00:00
|
|
|
</SentryRoute>
|
|
|
|
<SentryRoute path="/room/:roomId?">
|
2022-01-05 23:06:51 +00:00
|
|
|
<RoomPage />
|
2021-12-04 00:42:29 +00:00
|
|
|
</SentryRoute>
|
2022-02-01 23:11:06 +00:00
|
|
|
<SentryRoute path="/inspector">
|
|
|
|
<SequenceDiagramViewerPage />
|
|
|
|
</SentryRoute>
|
2021-12-10 21:27:27 +00:00
|
|
|
<SentryRoute path="*">
|
|
|
|
<RoomRedirect />
|
|
|
|
</SentryRoute>
|
2021-12-04 00:42:29 +00:00
|
|
|
</Switch>
|
2021-12-09 20:58:30 +00:00
|
|
|
</OverlayProvider>
|
|
|
|
</ClientProvider>
|
2021-12-04 00:42:29 +00:00
|
|
|
</Router>
|
2021-07-16 21:22:03 +00:00
|
|
|
);
|
|
|
|
}
|