2023-12-08 14:33:22 +01:00
|
|
|
import Providers from "@/context/providers";
|
|
|
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
|
|
|
import Wrapper from "@/components/Wrapper";
|
2024-02-27 22:39:05 +01:00
|
|
|
import Sidebar from "@/components/navigation/Sidebar";
|
2024-03-13 21:24:24 +01:00
|
|
|
|
2024-02-27 22:39:05 +01:00
|
|
|
import { isDesktop, isMobile } from "react-device-detect";
|
2024-02-22 03:27:02 +01:00
|
|
|
import Statusbar from "./components/Statusbar";
|
2024-02-27 22:39:05 +01:00
|
|
|
import Bottombar from "./components/navigation/Bottombar";
|
2024-03-13 21:24:24 +01:00
|
|
|
import { Suspense, lazy } from "react";
|
2024-04-10 15:40:17 +02:00
|
|
|
import { Redirect } from "./components/navigation/Redirect";
|
2024-05-16 18:51:57 +02:00
|
|
|
import { cn } from "./lib/utils";
|
2024-05-17 00:00:14 +02:00
|
|
|
import { isPWA } from "./utils/isPWA";
|
2024-03-13 21:24:24 +01:00
|
|
|
|
|
|
|
const Live = lazy(() => import("@/pages/Live"));
|
|
|
|
const Events = lazy(() => import("@/pages/Events"));
|
2024-04-20 00:11:41 +02:00
|
|
|
const Exports = lazy(() => import("@/pages/Exports"));
|
2024-03-13 21:24:24 +01:00
|
|
|
const SubmitPlus = lazy(() => import("@/pages/SubmitPlus"));
|
|
|
|
const ConfigEditor = lazy(() => import("@/pages/ConfigEditor"));
|
|
|
|
const System = lazy(() => import("@/pages/System"));
|
|
|
|
const Settings = lazy(() => import("@/pages/Settings"));
|
|
|
|
const UIPlayground = lazy(() => import("@/pages/UIPlayground"));
|
|
|
|
const Logs = lazy(() => import("@/pages/Logs"));
|
2023-12-08 14:33:22 +01:00
|
|
|
|
|
|
|
function App() {
|
|
|
|
return (
|
|
|
|
<Providers>
|
|
|
|
<BrowserRouter>
|
|
|
|
<Wrapper>
|
2024-04-01 17:31:31 +02:00
|
|
|
<div className="size-full overflow-hidden">
|
2024-02-27 22:39:05 +01:00
|
|
|
{isDesktop && <Sidebar />}
|
2024-02-22 03:27:02 +01:00
|
|
|
{isDesktop && <Statusbar />}
|
2024-02-27 22:39:05 +01:00
|
|
|
{isMobile && <Bottombar />}
|
2023-12-21 01:37:35 +01:00
|
|
|
<div
|
|
|
|
id="pageRoot"
|
2024-05-16 18:51:57 +02:00
|
|
|
className={cn(
|
|
|
|
"absolute right-0 top-0 overflow-hidden",
|
|
|
|
isMobile
|
2024-05-17 00:00:14 +02:00
|
|
|
? `bottom-${isPWA ? 16 : 12} left-0 md:bottom-16 landscape:bottom-14 landscape:md:bottom-16`
|
2024-05-16 18:51:57 +02:00
|
|
|
: "bottom-8 left-[52px]",
|
|
|
|
)}
|
2023-12-21 01:37:35 +01:00
|
|
|
>
|
2024-03-13 21:24:24 +01:00
|
|
|
<Suspense>
|
|
|
|
<Routes>
|
|
|
|
<Route path="/" element={<Live />} />
|
2024-04-10 15:40:17 +02:00
|
|
|
<Route path="/events" element={<Redirect to="/review" />} />
|
|
|
|
<Route path="/review" element={<Events />} />
|
2024-04-20 00:11:41 +02:00
|
|
|
<Route path="/export" element={<Exports />} />
|
2024-03-13 21:24:24 +01:00
|
|
|
<Route path="/plus" element={<SubmitPlus />} />
|
|
|
|
<Route path="/system" element={<System />} />
|
|
|
|
<Route path="/settings" element={<Settings />} />
|
|
|
|
<Route path="/config" element={<ConfigEditor />} />
|
|
|
|
<Route path="/logs" element={<Logs />} />
|
|
|
|
<Route path="/playground" element={<UIPlayground />} />
|
2024-05-26 18:17:52 +02:00
|
|
|
<Route path="*" element={<Redirect to="/" />} />
|
2024-03-13 21:24:24 +01:00
|
|
|
</Routes>
|
|
|
|
</Suspense>
|
2023-12-08 14:33:22 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Wrapper>
|
|
|
|
</BrowserRouter>
|
|
|
|
</Providers>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|