Skip to content

Commit

Permalink
Set params upon clicking the preview on pages
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Mar 20, 2024
1 parent 2107f6b commit 799c896
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/edit-site/src/components/layout/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Editor from '../editor';
import PagePages from '../page-pages';
import PagePatterns from '../page-patterns';
import PageTemplatesTemplateParts from '../page-templates-template-parts';
import { default as Link } from '../routes/link';

import {
TEMPLATE_POST_TYPE,
Expand All @@ -35,7 +36,16 @@ export default function useLayoutAreas() {
areas: {
content: <PagePages />,
preview: isListLayout && (
<Editor isLoading={ isSiteEditorLoading } />
<Link
params={ {
path,
postType: 'page',
postId,
canvas: 'edit',
} }
>
<Editor isLoading={ isSiteEditorLoading } />
</Link>
),
mobile:
canvas === 'edit' ? (
Expand Down

0 comments on commit 799c896

Please sign in to comment.