mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
chore: bump version to 0.20.0-rc.1 and fix client context
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"bin": "./dist/cli/index.js",
|
"bin": "./dist/cli/index.js",
|
||||||
"version": "0.19.0",
|
"version": "0.20.0-rc.1",
|
||||||
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
|
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
|
||||||
"homepage": "https://bknd.io",
|
"homepage": "https://bknd.io",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { BkndProvider } from "ui/client/bknd";
|
|||||||
import { useTheme, type AppTheme } from "ui/client/use-theme";
|
import { useTheme, type AppTheme } from "ui/client/use-theme";
|
||||||
import { Logo } from "ui/components/display/Logo";
|
import { Logo } from "ui/components/display/Logo";
|
||||||
import * as AppShell from "ui/layouts/AppShell/AppShell";
|
import * as AppShell from "ui/layouts/AppShell/AppShell";
|
||||||
import { ClientProvider, useBkndWindowContext, type ClientProviderProps } from "./client";
|
import { ClientProvider, useBkndWindowContext, type ClientProviderProps } from "bknd/client";
|
||||||
import { createMantineTheme } from "./lib/mantine/theme";
|
import { createMantineTheme } from "./lib/mantine/theme";
|
||||||
import { Routes } from "./routes";
|
import { Routes } from "./routes";
|
||||||
import type { BkndAdminAppShellOptions, BkndAdminEntitiesOptions } from "./options";
|
import type { BkndAdminAppShellOptions, BkndAdminEntitiesOptions } from "./options";
|
||||||
@@ -52,26 +52,30 @@ export type BkndAdminProps = {
|
|||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Admin({
|
export default function Admin(props: BkndAdminProps) {
|
||||||
baseUrl: baseUrlOverride,
|
|
||||||
withProvider = false,
|
|
||||||
config: _config = {},
|
|
||||||
children,
|
|
||||||
}: BkndAdminProps) {
|
|
||||||
const { theme } = useTheme();
|
|
||||||
const Provider = ({ children }: any) =>
|
const Provider = ({ children }: any) =>
|
||||||
withProvider ? (
|
props.withProvider ? (
|
||||||
<ClientProvider
|
<ClientProvider
|
||||||
baseUrl={baseUrlOverride}
|
baseUrl={props.baseUrl}
|
||||||
{...(typeof withProvider === "object" ? withProvider : {})}
|
{...(typeof props.withProvider === "object" ? props.withProvider : {})}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</ClientProvider>
|
</ClientProvider>
|
||||||
) : (
|
) : (
|
||||||
children
|
children
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Provider>
|
||||||
|
<AdminInner {...props} />
|
||||||
|
</Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function AdminInner(props: BkndAdminProps) {
|
||||||
|
const { theme } = useTheme();
|
||||||
const config = {
|
const config = {
|
||||||
..._config,
|
...props.config,
|
||||||
...useBkndWindowContext(),
|
...useBkndWindowContext(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,14 +86,12 @@ export default function Admin({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Provider>
|
<MantineProvider {...createMantineTheme(theme as any)}>
|
||||||
<MantineProvider {...createMantineTheme(theme as any)}>
|
<Notifications position="top-right" />
|
||||||
<Notifications position="top-right" />
|
<Routes BkndWrapper={BkndWrapper} basePath={config?.basepath}>
|
||||||
<Routes BkndWrapper={BkndWrapper} basePath={config?.basepath}>
|
{props.children}
|
||||||
{children}
|
</Routes>
|
||||||
</Routes>
|
</MantineProvider>
|
||||||
</MantineProvider>
|
|
||||||
</Provider>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const prerender = false;
|
|||||||
<Admin
|
<Admin
|
||||||
withProvider={{ user }}
|
withProvider={{ user }}
|
||||||
config={{ basepath: "/admin", theme: "dark", logo_return_path: "/../" }}
|
config={{ basepath: "/admin", theme: "dark", logo_return_path: "/../" }}
|
||||||
client:only
|
client:only="react"
|
||||||
/>
|
/>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user