Skip to content

Commit e42f2a2

Browse files
authored
Merge pull request #3 from payloadcms/fix/peer-deps
fix: react and react-dom peer dependencies
2 parents 3860912 + 63abe3e commit e42f2a2

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

packages/admin-bar/README.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Payload Admin Bar
22

3-
An admin bar for React apps using Payload CMS.
3+
An admin bar for React apps using [Payload](https://github.com/payloadcms/payload) as a headless CMS.
44

55
### Installation
66

@@ -13,7 +13,7 @@ $ yarn add payload-admin-bar
1313
### Basic Usage
1414

1515
```jsx
16-
import { PayloadAdminBar } from 'payload-admin-bar';
16+
import { PayloadAdminBar } from "payload-admin-bar";
1717

1818
export const App = () => {
1919
return (
@@ -22,8 +22,8 @@ export const App = () => {
2222
collection="pages"
2323
id="12345"
2424
/>
25-
)
26-
}
25+
);
26+
};
2727
```
2828

2929
Checks for authentication with Payload CMS by hitting the [`/me`](https://payloadcms.com/docs/authentication/operations#me) route. If authenticated, renders an admin bar with simple controls to do the following:
@@ -98,26 +98,27 @@ export const App = (appProps) => {
9898
```
9999

100100
### Props
101-
Property | Type | Required | Default | Description
102-
--- | --- | --- | --- | ---
103-
cmsURL | `string` | true | `http://localhost:8000` | `serverURL` as defined in your [Payload config](https://payloadcms.com/docs/configuration/overview#options)
104-
adminPath | `string` | false | /admin | `routes` as defined in your [Payload config](https://payloadcms.com/docs/configuration/overview#options)
105-
apiPath | `string` | false | /api | `routes` as defined in your [Payload config](https://payloadcms.com/docs/configuration/overview#options)
106-
collection | `string` | true | undefined | Slug of your [collection](https://payloadcms.com/docs/configuration/collections)
107-
collectionLabels | `{ singular?: string, plural?: string }` | false | undefined | Labels of your [collection](https://payloadcms.com/docs/configuration/collections)
108-
id | `string` | true | undefined | id of the document
109-
logo | `ReactElement` | false | undefined | Custom logo
110-
classNames | `{ logo?: string, user?: string, controls?: string, create?: string, logout?: string, edit?: string, preview?: string }` | false | undefined | Custom class names, one for each rendered element
111-
logoProps | `{[key: string]?: unknown}` | false | undefined | Custom props
112-
userProps | `{[key: string]?: unknown}` | false | undefined | Custom props
113-
divProps | `{[key: string]?: unknown}` | false | undefined | Custom props
114-
createProps | `{[key: string]?: unknown}` | false | undefined | Custom props
115-
logoutProps | `{[key: string]?: unknown}` | false | undefined | Custom props
116-
editProps | `{[key: string]?: unknown}` | false | undefined | Custom props
117-
previewProps | `{[key: string]?: unknown}` | false | undefined | Custom props
118-
style | `CSSProperties` | false | undefined | Custom inline style
119-
unstyled | `boolean` | false | undefined | If true, renders no inline style
120-
onAuthChange | `(user: PayloadMeUser) => void` | false | undefined | Fired on each auth change
121-
devMode | `boolean` | false | undefined | If true, fakes authentication (useful when dealing with [SameSite cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite))
122-
preview | `boolean` | false | undefined | If true, renders an exit button with your `onPreviewExit` handler)
123-
onPreviewExit | `function` | false | undefined | Callback for the preview button `onClick` event)
101+
102+
| Property | Type | Required | Default | Description |
103+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ | -------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
104+
| cmsURL | `string` | true | `http://localhost:8000` | `serverURL` as defined in your [Payload config](https://payloadcms.com/docs/configuration/overview#options) |
105+
| adminPath | `string` | false | /admin | `routes` as defined in your [Payload config](https://payloadcms.com/docs/configuration/overview#options) |
106+
| apiPath | `string` | false | /api | `routes` as defined in your [Payload config](https://payloadcms.com/docs/configuration/overview#options) |
107+
| collection | `string` | true | undefined | Slug of your [collection](https://payloadcms.com/docs/configuration/collections) |
108+
| collectionLabels | `{ singular?: string, plural?: string }` | false | undefined | Labels of your [collection](https://payloadcms.com/docs/configuration/collections) |
109+
| id | `string` | true | undefined | id of the document |
110+
| logo | `ReactElement` | false | undefined | Custom logo |
111+
| classNames | `{ logo?: string, user?: string, controls?: string, create?: string, logout?: string, edit?: string, preview?: string }` | false | undefined | Custom class names, one for each rendered element |
112+
| logoProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
113+
| userProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
114+
| divProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
115+
| createProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
116+
| logoutProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
117+
| editProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
118+
| previewProps | `{[key: string]?: unknown}` | false | undefined | Custom props |
119+
| style | `CSSProperties` | false | undefined | Custom inline style |
120+
| unstyled | `boolean` | false | undefined | If true, renders no inline style |
121+
| onAuthChange | `(user: PayloadMeUser) => void` | false | undefined | Fired on each auth change |
122+
| devMode | `boolean` | false | undefined | If true, fakes authentication (useful when dealing with [SameSite cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite)) |
123+
| preview | `boolean` | false | undefined | If true, renders an exit button with your `onPreviewExit` handler) |
124+
| onPreviewExit | `function` | false | undefined | Callback for the preview button `onClick` event) |

packages/admin-bar/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"lint": "eslint ."
2323
},
2424
"peerDependencies": {
25-
"react": "^17.0.0",
26-
"react-dom": "^17.0.0"
25+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
26+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
2727
},
2828
"devDependencies": {
2929
"@types/react": "^17.0.0",

0 commit comments

Comments
 (0)