Skip to content

Commit

Permalink
Add documentation for DocumentBar (#61733)
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 c706195 commit 9acffd0
Show file tree
Hide file tree
Showing 2 changed files with 23 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 @@ -254,7 +254,17 @@ _Returns_
### DocumentBar

Undocumented declaration.
This component renders a navigation bar at the top of the editor. It displays the title of the current document, a back button (if applicable), and a command center button. It also handles different states of the document, such as "not found" or "unsynced".

_Usage_

```jsx
<DocumentBar />
```

_Returns_

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

### DocumentOutline

Expand Down
12 changes: 12 additions & 0 deletions packages/editor/src/components/document-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ const GLOBAL_POST_TYPES = [

const MotionButton = motion( Button );

/**
* This component renders a navigation bar at the top of the editor. It displays the title of the current document,
* a back button (if applicable), and a command center button. It also handles different states of the document,
* such as "not found" or "unsynced".
*
* @example
* ```jsx
* <DocumentBar />
* ```
*
* @return {JSX.Element} The rendered DocumentBar component.
*/
export default function DocumentBar() {
const {
postType,
Expand Down

1 comment on commit 9acffd0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 9acffd0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9169564348
📝 Reported issues:

Please sign in to comment.