Skip to content

Commit

Permalink
Add documentation for the EditorNotices component (WordPress#61736)
Browse files Browse the repository at this point in the history
Co-authored-by: nateinaction <[email protected]>
Co-authored-by: colorful-tones <[email protected]>
  • Loading branch information
3 people authored May 21, 2024
1 parent 9acffd0 commit 0f68078
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,17 @@ _Returns_

### EditorNotices

Undocumented declaration.
This component renders the notices displayed in the editor. It displays pinned notices first, followed by dismissible

_Usage_

```jsx
<EditorNotices />
```

_Returns_

- `JSX.Element`: The rendered EditorNotices component.

### EditorProvider

Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/editor-notices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ import { store as noticesStore } from '@wordpress/notices';
*/
import TemplateValidationNotice from '../template-validation-notice';

/**
* This component renders the notices displayed in the editor. It displays pinned notices first, followed by dismissible
*
* @example
* ```jsx
* <EditorNotices />
* ```
*
* @return {JSX.Element} The rendered EditorNotices component.
*/
export function EditorNotices() {
const { notices } = useSelect(
( select ) => ( {
Expand Down

0 comments on commit 0f68078

Please sign in to comment.