mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Port settings.
This commit is contained in:
31
src/pages/app.tsx
Normal file
31
src/pages/app.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CheckAuth } from "../context/revoltjs/CheckAuth";
|
||||
import Preloader from "../components/ui/Preloader";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Context from "../context";
|
||||
|
||||
import { lazy, Suspense } from "preact/compat";
|
||||
const Login = lazy(() => import('./login/Login'));
|
||||
const RevoltApp = lazy(() => import('./RevoltApp'));
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<Context>
|
||||
{/*
|
||||
// @ts-expect-error */}
|
||||
<Suspense fallback={<Preloader />}>
|
||||
<Switch>
|
||||
<Route path="/login">
|
||||
<CheckAuth>
|
||||
<Login />
|
||||
</CheckAuth>
|
||||
</Route>
|
||||
<Route path="/">
|
||||
<CheckAuth auth>
|
||||
<RevoltApp />
|
||||
</CheckAuth>
|
||||
</Route>
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</Context>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user