From 03aac3437b0a9d5f4734abbfe50d30d198dd3b7c Mon Sep 17 00:00:00 2001 From: cameronapak Date: Tue, 22 Jul 2025 08:33:42 -0500 Subject: [PATCH] refactor: unify theme type and admin options from AdminController --- app/src/modules/server/AdminController.tsx | 3 ++- app/src/ui/client/BkndProvider.tsx | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/modules/server/AdminController.tsx b/app/src/modules/server/AdminController.tsx index 5cb66d6..59fcda3 100644 --- a/app/src/modules/server/AdminController.tsx +++ b/app/src/modules/server/AdminController.tsx @@ -10,6 +10,7 @@ import { css, Style } from "hono/css"; import { Controller } from "modules/Controller"; import * as SystemPermissions from "modules/permissions"; import type { TApiUser } from "Api"; +import type { AppTheme } from "ui/client/use-theme"; const htmlBkndContextReplace = ""; @@ -18,7 +19,7 @@ export type AdminBkndWindowContext = { logout_route: string; admin_basepath: string; logo_return_path?: string; - theme?: "dark" | "light" | "system"; + theme?: AppTheme; }; // @todo: add migration to remove admin path from config diff --git a/app/src/ui/client/BkndProvider.tsx b/app/src/ui/client/BkndProvider.tsx index 113ec73..964d82a 100644 --- a/app/src/ui/client/BkndProvider.tsx +++ b/app/src/ui/client/BkndProvider.tsx @@ -4,15 +4,11 @@ import { createContext, startTransition, useContext, useEffect, useRef, useState import { useApi } from "ui/client"; import { type TSchemaActions, getSchemaActions } from "./schema/actions"; import { AppReduced } from "./utils/AppReduced"; -import type { AppTheme } from "ui/client/use-theme"; import { Message } from "ui/components/display/Message"; import { useNavigate } from "ui/lib/routes"; +import type { AdminBkndWindowContext } from "modules/server/AdminController"; -export type BkndAdminOptions = { - admin_basepath?: string; - logo_return_path?: string; - theme?: AppTheme; -}; +export type BkndAdminOptions = Omit type BkndContext = { version: number; schema: ModuleSchemas;