2021-06-18 20:07:26 +01:00
|
|
|
import { Route, Switch } from "react-router-dom";
|
2021-06-18 17:57:08 +01:00
|
|
|
|
2021-06-19 12:34:53 +01:00
|
|
|
import { lazy, Suspense } from "preact/compat";
|
2021-07-05 11:23:23 +01:00
|
|
|
|
|
|
|
import Context from "../context";
|
|
|
|
import { CheckAuth } from "../context/revoltjs/CheckAuth";
|
|
|
|
|
|
|
|
import Masks from "../components/ui/Masks";
|
|
|
|
import Preloader from "../components/ui/Preloader";
|
|
|
|
|
|
|
|
const Login = lazy(() => import("./login/Login"));
|
|
|
|
const RevoltApp = lazy(() => import("./RevoltApp"));
|
2021-06-18 22:47:25 +01:00
|
|
|
|
2021-06-18 12:05:01 +01:00
|
|
|
export function App() {
|
2021-07-05 11:25:20 +01:00
|
|
|
return (
|
|
|
|
<Context>
|
|
|
|
<Masks />
|
|
|
|
{/*
|
2021-08-05 14:47:00 +01:00
|
|
|
// @ts-expect-error typings mis-match between preact... and preact? */}
|
2021-07-05 11:25:20 +01:00
|
|
|
<Suspense fallback={<Preloader type="spinner" />}>
|
|
|
|
<Switch>
|
|
|
|
<Route path="/login">
|
|
|
|
<CheckAuth>
|
|
|
|
<Login />
|
|
|
|
</CheckAuth>
|
|
|
|
</Route>
|
|
|
|
<Route path="/">
|
|
|
|
<CheckAuth auth>
|
|
|
|
<RevoltApp />
|
|
|
|
</CheckAuth>
|
|
|
|
</Route>
|
|
|
|
</Switch>
|
|
|
|
</Suspense>
|
|
|
|
</Context>
|
|
|
|
);
|
2021-06-18 12:05:01 +01:00
|
|
|
}
|