Skip to content

Commit

Permalink
Revert the changes to packages/edit-site/src/components/site-editor-r…
Browse files Browse the repository at this point in the history
…outes/templates.js as they're taken care of in #67547
  • Loading branch information
ramonjd committed Dec 4, 2024
1 parent 990a1c9 commit a6d5028
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
/**
* WordPress dependencies
*/
import { privateApis as routerPrivateApis } from '@wordpress/router';

/**
* Internal dependencies
*/
import Editor from '../editor';
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
import { unlock } from '../../lock-unlock';
import PageTemplates from '../page-templates';

const { useLocation } = unlock( routerPrivateApis );

function MobileTemplatesView() {
const { query = {} } = useLocation();
const { canvas = 'view' } = query;

return canvas === 'edit' ? (
<Editor />
) : (
<SidebarNavigationScreenTemplatesBrowse backPath="/" />
);
}

export const templatesRoute = {
name: 'templates',
path: '/template',
Expand All @@ -15,7 +34,7 @@ export const templatesRoute = {
const isListView = query.layout === 'list';
return isListView ? <Editor /> : undefined;
},
mobile: <PageTemplates />,
mobile: <MobileTemplatesView />,
},
widths: {
content( { query } ) {
Expand Down

0 comments on commit a6d5028

Please sign in to comment.