mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fixing imports and ssr support + updated remix/nextjs/astro examples
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
import { adminPage, getServerSideProps } from "bknd/adapter/nextjs";
|
||||
import { withApi } from "bknd/adapter/nextjs";
|
||||
import dynamic from "next/dynamic";
|
||||
import "bknd/dist/styles.css";
|
||||
|
||||
export { getServerSideProps };
|
||||
export default adminPage({
|
||||
config: {
|
||||
basepath: "/admin"
|
||||
}
|
||||
const Admin = dynamic(() => import("bknd/ui").then((mod) => mod.Admin), {
|
||||
ssr: false
|
||||
});
|
||||
|
||||
export const getServerSideProps = withApi(async (context) => {
|
||||
return {
|
||||
props: {
|
||||
user: context.api.getUser()
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
export default function AdminPage() {
|
||||
if (typeof document === "undefined") return null;
|
||||
return <Admin withProvider config={{ basepath: "/admin" }} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user