diff --git a/packages/edit-site/src/components/block-editor/editor-canvas.js b/packages/edit-site/src/components/block-editor/editor-canvas.js index 321749fa70c84..4f5237b7fdf92 100644 --- a/packages/edit-site/src/components/block-editor/editor-canvas.js +++ b/packages/edit-site/src/components/block-editor/editor-canvas.js @@ -28,13 +28,7 @@ import { const { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis ); -function EditorCanvas( { - enableResizing, - settings, - children, - onClick, - ...props -} ) { +function EditorCanvas( { enableResizing, settings, children, ...props } ) { const { hasBlocks, isFocusMode, @@ -88,11 +82,7 @@ function EditorCanvas( { } }, onClick: () => { - if ( !! onClick ) { - onClick(); - } else { - setCanvasMode( 'edit' ); - } + setCanvasMode( 'edit' ); }, onClickCapture: ( event ) => { if ( currentPostIsTrashed ) { diff --git a/packages/edit-site/src/components/block-editor/site-editor-canvas.js b/packages/edit-site/src/components/block-editor/site-editor-canvas.js index bd8d611fda0f4..9a74652b53cab 100644 --- a/packages/edit-site/src/components/block-editor/site-editor-canvas.js +++ b/packages/edit-site/src/components/block-editor/site-editor-canvas.js @@ -27,7 +27,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; const { useLocation } = unlock( routerPrivateApis ); -export default function SiteEditorCanvas( { onClick } ) { +export default function SiteEditorCanvas() { const location = useLocation(); const { templateType, isFocusableEntity, isViewMode, isZoomOutMode } = useSelect( ( select ) => { @@ -89,7 +89,6 @@ export default function SiteEditorCanvas( { onClick } ) { { // Avoid resize listeners when not needed, diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index c094f1e628256..d8ebf2c1f5486 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -83,7 +83,7 @@ const interfaceLabels = { const ANIMATION_DURATION = 0.25; -export default function Editor( { isLoading, onClick } ) { +export default function Editor( { isLoading } ) { const { record: editedPost, getTitle, @@ -351,9 +351,7 @@ export default function Editor( { isLoading, onClick } ) { { ! isLargeViewport && showVisualEditor && ( ) } - { showVisualEditor && ( - - ) } + { showVisualEditor && } } secondarySidebar={ diff --git a/packages/edit-site/src/components/layout/router.js b/packages/edit-site/src/components/layout/router.js index 50d8c84319e5e..f3c0f40c73c95 100644 --- a/packages/edit-site/src/components/layout/router.js +++ b/packages/edit-site/src/components/layout/router.js @@ -75,7 +75,6 @@ function useRedirectOldPaths() { export default function useLayoutAreas() { const isSiteEditorLoading = useIsSiteEditorLoading(); - const history = useHistory(); const { params } = useLocation(); const { postType, postId, path, layout, isCustom, canvas } = params; useRedirectOldPaths(); @@ -95,16 +94,7 @@ export default function useLayoutAreas() { ), content: , preview: ( isListLayout || canvas === 'edit' ) && ( - - history.push( { - postType: 'page', - postId, - canvas: 'edit', - } ) - } - /> + ), mobile: canvas === 'edit' ? (