admin: add options such as logo return path when served static

This commit is contained in:
dswbx
2025-06-18 07:56:58 +02:00
parent aaa97ed113
commit c86f4c12b7
3 changed files with 16 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ import { BkndProvider, type BkndAdminOptions } 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 { ClientProvider, type ClientProviderProps } from "./client";
import { ClientProvider, useBkndWindowContext, type ClientProviderProps } from "./client";
import { createMantineTheme } from "./lib/mantine/theme";
import { Routes } from "./routes";
@@ -18,7 +18,7 @@ export type BkndAdminProps = {
export default function Admin({
baseUrl: baseUrlOverride,
withProvider = false,
config,
config: _config = {},
}: BkndAdminProps) {
const { theme } = useTheme();
const Provider = ({ children }: any) =>
@@ -32,6 +32,10 @@ export default function Admin({
) : (
children
);
const config = {
..._config,
...useBkndWindowContext(),
};
const BkndWrapper = ({ children }: { children: ReactNode }) => (
<BkndProvider options={config} fallback={<Skeleton theme={config?.theme} />}>

View File

@@ -9,8 +9,8 @@ import { Message } from "ui/components/display/Message";
import { useNavigate } from "ui/lib/routes";
export type BkndAdminOptions = {
logo_return_path?: string;
basepath?: string;
logo_return_path?: string;
theme?: AppTheme;
};
type BkndContext = {