element-call/src/App.jsx

60 lines
1.9 KiB
React
Raw Normal View History

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";
2021-08-20 23:23:12 +00:00
import { LoginPage } from "./LoginPage";
2021-12-09 20:58:30 +00:00
import { RegisterPage } from "./RegisterPage";
2022-01-05 23:06:51 +00:00
import { RoomPage } from "./room/RoomPage";
import { RoomRedirect } from "./room/RoomRedirect";
import { ClientProvider } from "./ConferenceCallManagerHooks";
2021-12-23 22:40:23 +00:00
import { usePageFocusStyle } from "./usePageFocusStyle";
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>
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
);
}