Conversation
|
Size Change: -531 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in edb424f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5309640103
|
This comment was marked as resolved.
This comment was marked as resolved.
a176086 to
3dee12c
Compare
|
This PR does expose some of the loading inadequacies. Let's tidy those in a follow up. |
packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
| ); | ||
| } | ||
| }; | ||
| const _handleDelete = () => handleDelete( navigationMenu ); |
There was a problem hiding this comment.
Is this a pattern we use elsewhere? Another option could be to call it handleDeleteBound...
There was a problem hiding this comment.
Yeh I mean...it isn't exactly elegant 🤷
I'm not 100% about the API on this hook yet. Let's allow new requirements to drive any further refactoring however.
…on route in Browse Mode (WordPress#51565) * Remove custom button and show single menu on Navigation route * Extract hooks * Pass menu to all hooks * Use SingleMenu component and hooks on Navigation listing route * Move hooks to file file * Consolidate to a single hook * Improve hooks by passing arg at call time * Rename hooks
What?
Renders a single Navigation directly on the
/navigationroute of the Site Editor if there is only a single menu. If there are multiple menus then we render a list as pertrunk.Closes #51561
Why?
Reasoning was outlined by Riad in #51561.
This change avoids requiring consumers of the Site Editor routes from having to programmatically determine which route to send someone to if they have a single menu vs multiple menus.
We encapsulate the behaviour and logic inside the route components and thus a consumer can simply go to
/navigationand know they will see the "right" thing.How?
Extracts the code for displaying a single menu into reusable component and hooks. Then shares this between the routes for both
/navigationrouteTesting Instructions
Navigationin Browse Mode.Navigation.Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2023-06-16.at.15-47-10.mp4