Skip to content

Commit

Permalink
Site Editor: show pattern category step in navigation for mobile (#69206
Browse files Browse the repository at this point in the history
)

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: stokesman <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2025
1 parent f017b64 commit 4ad117c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/edit-site/src/components/site-editor-routes/patterns.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
/**
* WordPress dependencies
*/
import { privateApis as routerPrivateApis } from '@wordpress/router';

/**
* Internal dependencies
*/
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
import PagePatterns from '../page-patterns';
import { unlock } from '../../lock-unlock';

const { useLocation } = unlock( routerPrivateApis );

function MobilePatternsView() {
const { query = {} } = useLocation();
const { categoryId } = query;

return !! categoryId ? (
<PagePatterns />
) : (
<SidebarNavigationScreenPatterns backPath="/" />
);
}

export const patternsRoute = {
name: 'patterns',
path: '/pattern',
areas: {
sidebar: <SidebarNavigationScreenPatterns backPath="/" />,
content: <PagePatterns />,
mobile: <PagePatterns />,
mobile: <MobilePatternsView />,
},
};

0 comments on commit 4ad117c

Please sign in to comment.