Skip to content

Commit

Permalink
chore: update docs (#78)
Browse files Browse the repository at this point in the history
* chore: update docs

* Create two-singers-chew.md

* Fix CI

* Improve npmignore

* Update changelog for v3.0.0

* Update CHANGELOG.md
  • Loading branch information
foyarash authored Dec 4, 2023
1 parent 216ba52 commit 84ea409
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-singers-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@premieroctet/next-admin": patch
---

chore: update docs
2 changes: 1 addition & 1 deletion apps/docs/pages/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This will create a `json-schema.json` file in the `prisma/json-schema` directory

Passing the `options` prop like you'd do on Page router will result in an error in case you
have functions defined inside the options object (formatter, handlers, etc.).
Make sure to pass no option at all.
Make sure to pass no `options` prop at all.

</Callout>

Expand Down
1 change: 1 addition & 0 deletions apps/docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ This library is still under development. The following features are available:
- 🎨 Dashboard widgets and customizable panels
- ⚛️ Integration with Prisma ORM
- 👔 Customizable list and form
- ⚙️ Supports App Router and Page Router

If you want to request a feature, please open an issue [here](https://github.com/premieroctet/next-admin/issues/new)
3 changes: 2 additions & 1 deletion apps/docs/theme.config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const config = {
text: `MIT ${new Date().getFullYear()} © Premier Octet.`,
},
darkMode: true,
primaryHue: 290,
primaryHue: 209,
primarySaturation: 100,
head: (
<>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down
5 changes: 5 additions & 0 deletions packages/next-admin/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
node_modules
.turbo
src
jest.config.js
tsconfig.json
tailwind.config.js
postcss.config.js
35 changes: 35 additions & 0 deletions packages/next-admin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@
- App router is now supported. You can find an exemple of its usage in the example app.
- New context object, currently passed only to the `formatter` function

You can now use App Router like the following:

```tsx
// app/admin/[[...nextadmin]]/page.tsx
import { NextAdmin } from "@premieroctet/next-admin";
import { getPropsFromParams } from "@premieroctet/next-admin/dist/appRouter";
import "@premieroctet/next-admin/dist/styles.css";
import Dashboard from "../../../components/Dashboard";
import { options } from "../../../options";
import { prisma } from "../../../prisma";
import schema from "../../../prisma/json-schema/json-schema.json"; // generated by prisma-json-schema-generator on yarn run prisma generate
import "../../../styles.css";
import { submitFormAction } from "../../../actions/nextadmin";

export default async function AdminPage({
params,
searchParams,
}: {
params: { [key: string]: string[] };
searchParams: { [key: string]: string | string[] | undefined } | undefined;
}) {
const props = await getPropsFromParams({
params: params.nextadmin,
searchParams,
options,
prisma,
schema,
action: submitFormAction,
});

return <NextAdmin {...props} dashboard={Dashboard} />;
}
```

## 2.0.0

### Major Changes
Expand Down Expand Up @@ -132,3 +166,4 @@
### Major Changes

- 6af8145: Fist release of @premieroctet/next-admin package (unstable)

1 change: 1 addition & 0 deletions packages/next-admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- 🎨 Dashboard widgets and customizable panels
- ⚛️ Integration with Prisma ORM
- 👔 Customizable list and form
- ⚙️ Supports App Router and Page Router

## Installation

Expand Down

0 comments on commit 84ea409

Please sign in to comment.