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:
@@ -15,7 +15,7 @@ export const prerender = false;
|
||||
<Admin
|
||||
withProvider={{ user }}
|
||||
config={{ basepath: "/admin", color_scheme: "dark" }}
|
||||
client:load
|
||||
client:only
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@ export const ALL = serve({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://127.0.0.1:8080"
|
||||
url: "file:test.db"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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" }} />;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ const handler = serve({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://localhost:8080"
|
||||
url: "file:test.db"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user