mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
refactor: unify theme type and admin options from AdminController
This commit is contained in:
@@ -10,6 +10,7 @@ import { css, Style } from "hono/css";
|
|||||||
import { Controller } from "modules/Controller";
|
import { Controller } from "modules/Controller";
|
||||||
import * as SystemPermissions from "modules/permissions";
|
import * as SystemPermissions from "modules/permissions";
|
||||||
import type { TApiUser } from "Api";
|
import type { TApiUser } from "Api";
|
||||||
|
import type { AppTheme } from "ui/client/use-theme";
|
||||||
|
|
||||||
const htmlBkndContextReplace = "<!-- BKND_CONTEXT -->";
|
const htmlBkndContextReplace = "<!-- BKND_CONTEXT -->";
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ export type AdminBkndWindowContext = {
|
|||||||
logout_route: string;
|
logout_route: string;
|
||||||
admin_basepath: string;
|
admin_basepath: string;
|
||||||
logo_return_path?: string;
|
logo_return_path?: string;
|
||||||
theme?: "dark" | "light" | "system";
|
theme?: AppTheme;
|
||||||
};
|
};
|
||||||
|
|
||||||
// @todo: add migration to remove admin path from config
|
// @todo: add migration to remove admin path from config
|
||||||
|
|||||||
@@ -4,15 +4,11 @@ import { createContext, startTransition, useContext, useEffect, useRef, useState
|
|||||||
import { useApi } from "ui/client";
|
import { useApi } from "ui/client";
|
||||||
import { type TSchemaActions, getSchemaActions } from "./schema/actions";
|
import { type TSchemaActions, getSchemaActions } from "./schema/actions";
|
||||||
import { AppReduced } from "./utils/AppReduced";
|
import { AppReduced } from "./utils/AppReduced";
|
||||||
import type { AppTheme } from "ui/client/use-theme";
|
|
||||||
import { Message } from "ui/components/display/Message";
|
import { Message } from "ui/components/display/Message";
|
||||||
import { useNavigate } from "ui/lib/routes";
|
import { useNavigate } from "ui/lib/routes";
|
||||||
|
import type { AdminBkndWindowContext } from "modules/server/AdminController";
|
||||||
|
|
||||||
export type BkndAdminOptions = {
|
export type BkndAdminOptions = Omit<AdminBkndWindowContext, "user" | "logout_route">
|
||||||
admin_basepath?: string;
|
|
||||||
logo_return_path?: string;
|
|
||||||
theme?: AppTheme;
|
|
||||||
};
|
|
||||||
type BkndContext = {
|
type BkndContext = {
|
||||||
version: number;
|
version: number;
|
||||||
schema: ModuleSchemas;
|
schema: ModuleSchemas;
|
||||||
|
|||||||
Reference in New Issue
Block a user