-
-
- Initializing...
-
+
+
+ Initializing...
{!isProd && }
@@ -246,31 +247,27 @@ export class AdminController extends Controller {
}
}
-const style = (theme: AppTheme) => {
- const base = {
- margin: 0,
- padding: 0,
- height: "100vh",
- width: "100vw",
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
- "-webkit-font-smoothing": "antialiased",
- "-moz-osx-font-smoothing": "grayscale"
- };
- const styles = {
- light: {
- color: "rgb(9,9,11)",
- backgroundColor: "rgb(250,250,250)"
- },
- dark: {
- color: "rgb(250,250,250)",
- backgroundColor: "rgb(30,31,34)"
- }
- };
+const wrapperStyle = css`
+ margin: 0;
+ padding: 0;
+ height: 100vh;
+ width: 100vw;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ color: rgb(9,9,11);
+ background-color: rgb(250,250,250);
+
+ @media (prefers-color-scheme: dark) {
+ color: rgb(250,250,250);
+ background-color: rgb(30,31,34);
+ }
+`;
- return {
- ...base,
- ...styles[theme === "light" ? "light" : "dark"]
- };
-};
+const loaderStyle = css`
+ opacity: 0.3;
+ font-size: 14px;
+ font-family: monospace;
+`;
diff --git a/app/src/ui/Admin.tsx b/app/src/ui/Admin.tsx
index 38d6cec..157b8b7 100644
--- a/app/src/ui/Admin.tsx
+++ b/app/src/ui/Admin.tsx
@@ -2,11 +2,10 @@ import { MantineProvider } from "@mantine/core";
import { Notifications } from "@mantine/notifications";
import type { ModuleConfigs } from "modules";
import React from "react";
-import { BkndProvider, useBknd } from "ui/client/bknd";
+import { BkndProvider } from "ui/client/bknd";
import { useTheme } from "ui/client/use-theme";
import { Logo } from "ui/components/display/Logo";
import * as AppShell from "ui/layouts/AppShell/AppShell";
-import { FlashMessage } from "ui/modules/server/FlashMessage";
import { ClientProvider, type ClientProviderProps } from "./client";
import { createMantineTheme } from "./lib/mantine/theme";
import { BkndModalsProvider } from "./modals";
@@ -21,7 +20,7 @@ export type BkndAdminProps = {
export default function Admin({
baseUrl: baseUrlOverride,
withProvider = false,
- config
+ config,
}: BkndAdminProps) {
const Component = (
}>
@@ -45,8 +44,7 @@ function AdminInternal() {
return (
-
-
+
@@ -54,9 +52,9 @@ function AdminInternal() {
);
}
-const Skeleton = ({ theme }: { theme?: string }) => {
- const actualTheme =
- (theme ?? document.querySelector("html")?.classList.contains("light")) ? "light" : "dark";
+const Skeleton = ({ theme }: { theme?: any }) => {
+ const t = useTheme();
+ const actualTheme = theme ?? t.theme;
return (
diff --git a/app/src/ui/modules/server/FlashMessage.tsx b/app/src/ui/modules/server/FlashMessage.tsx
index 4b5bc2b..0617f67 100644
--- a/app/src/ui/modules/server/FlashMessage.tsx
+++ b/app/src/ui/modules/server/FlashMessage.tsx
@@ -7,7 +7,7 @@ import { Alert } from "ui/components/display/Alert";
* @constructor
*/
export function FlashMessage() {
- const [flash, setFlash] = useState
();
+ const [flash, setFlash] = useState>();
useEffect(() => {
if (!flash) {
diff --git a/app/src/ui/routes/index.tsx b/app/src/ui/routes/index.tsx
index db1fb0f..d5fd6a2 100644
--- a/app/src/ui/routes/index.tsx
+++ b/app/src/ui/routes/index.tsx
@@ -1,4 +1,4 @@
-import { Suspense, lazy } from "react";
+import React, { Suspense, lazy } from "react";
import { useBknd } from "ui/client/bknd";
import { useTheme } from "ui/client/use-theme";
import { Route, Router, Switch } from "wouter";
@@ -9,6 +9,7 @@ import FlowRoutes from "./flows";
import MediaRoutes from "./media";
import { Root, RootEmpty } from "./root";
import SettingsRoutes from "./settings";
+import { FlashMessage } from "ui/modules/server/FlashMessage";
// @ts-ignore
const TestRoutes = lazy(() => import("./test"));
@@ -20,6 +21,7 @@ export function Routes() {
return (
+