mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
moved almost all deps to dev to speed up installs, updated nextjs docs
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { withApi } from "bknd/adapter/nextjs";
|
||||
import type { BkndAdminProps } from "bknd/ui";
|
||||
import type { InferGetServerSidePropsType } from "next";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
export const getServerSideProps = withApi(async (context) => {
|
||||
return {
|
||||
props: {
|
||||
user: context.api.getUser()
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
export function adminPage(adminProps?: BkndAdminProps) {
|
||||
const Admin = dynamic(() => import("bknd/ui").then((mod) => mod.Admin), { ssr: false });
|
||||
return (props: InferGetServerSidePropsType<typeof getServerSideProps>) => {
|
||||
if (typeof document === "undefined") return null;
|
||||
return <Admin withProvider={{ user: props.user }} {...adminProps} />;
|
||||
};
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
export * from "./nextjs.adapter";
|
||||
export * from "./AdminPage";
|
||||
|
||||
Reference in New Issue
Block a user