Skip to content

Commit

Permalink
Add: Navigation menus to the browse mode sidebar.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Dec 16, 2022
1 parent f8efb0d commit 00c37d3
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.edit-site-sidebar-navigation-item.components-item {
.edit-site-sidebar-navigation-item.components-item,
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button {
color: $gray-600;
border-width: $border-width-tab;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Button,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { layout, symbolFilled } from '@wordpress/icons';
import { layout, symbolFilled, navigation } from '@wordpress/icons';
import { useDispatch } from '@wordpress/data';
import { useViewportMatch } from '@wordpress/compose';

Expand Down Expand Up @@ -49,6 +49,14 @@ export default function SidebarNavigationScreenMain() {
}
content={
<ItemGroup>
<NavigatorButton
as={ SidebarNavigationItem }
path="/navigation-menus"
withChevron
icon={ navigation }
>
{ __( 'Navigation menus' ) }
</NavigatorButton>
<NavigatorButton
as={ SidebarNavigationItem }
path="/templates"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import SidebarNavigationScreen from '../sidebar-navigation-screen';
import NavigationInspector from '../sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector';

export default function SidebarNavigationScreenNavigationMenus() {
return (
<SidebarNavigationScreen
path="/navigation-menus"
parentTitle={ __( 'Design' ) }
title={ __( 'Navigation menus' ) }
content={
<div className="edit-site-sidebar-navigation-screen-navigation-menus">
<NavigationInspector />
</div>
}
/>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.edit-site-sidebar-navigation-screen-navigation-menus {
margin: 0 #{-$button-size} 0 #{-$grid-unit-30};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
.edit-site-sidebar-navigation-screen__content {
margin: 0 $grid-unit-20 0 $button-size;
flex-grow: 1;
overflow-y: auto;
}

.edit-site-sidebar-navigation-screen__title-icon {
Expand Down
2 changes: 2 additions & 0 deletions packages/edit-site/src/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
import useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';

function SidebarScreens() {
useSyncSidebarPathWithURL();

return (
<>
<SidebarNavigationScreenMain />
<SidebarNavigationScreenNavigationMenus />
<SidebarNavigationScreenTemplates postType="wp_template" />
<SidebarNavigationScreenTemplates postType="wp_template_part" />
</>
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@import "./components/sidebar-navigation-item/style.scss";
@import "./components/sidebar-navigation-screen/style.scss";
@import "./components/sidebar-navigation-screen-templates/style.scss";
@import "./components/sidebar-navigation-screen-navigation-menus/style.scss";
@import "./components/site-icon/style.scss";
@import "./components/style-book/style.scss";
@import "./hooks/push-changes-to-global-styles/style.scss";
Expand Down

1 comment on commit 00c37d3

@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.
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/3712287580
📝 Reported issues:

Please sign in to comment.