From 41f34a447289432b6e0701b193614b556428b8d7 Mon Sep 17 00:00:00 2001 From: karthick-murugan Date: Wed, 18 Dec 2024 18:45:41 +0530 Subject: [PATCH] Linting issues updated --- .../editor/src/components/commands/index.js | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/editor/src/components/commands/index.js b/packages/editor/src/components/commands/index.js index 896fac65d39e76..6446c473c741f0 100644 --- a/packages/editor/src/components/commands/index.js +++ b/packages/editor/src/components/commands/index.js @@ -15,7 +15,6 @@ import { external, keyboard, symbol, - page, layout, rotateRight, rotateLeft, @@ -468,25 +467,26 @@ const getManipulateDocumentCommands = () => }; }; -function useSiteEditorCommandLoader() { - const commands = []; - commands.push( { - name: 'core/drafts', - label: __( 'Pages/Drafts' ), - keywords: [ 'drafts' ], - icon: page, - callback: ( { close } ) => { - close(); - window.location.href = - '/wp-admin/site-editor.php?postType=page&layout=list&activeView=drafts'; - }, - } ); +const getuseSiteEditorCommandLoader = () => + function useSiteEditorCommandLoader() { + const commands = []; + commands.push( { + name: 'core/drafts', + label: __( 'Pages/Drafts' ), + keywords: [ 'drafts' ], + icon: page, + callback: ( { close } ) => { + close(); + window.location.href = + '/wp-admin/site-editor.php?postType=page&layout=list&activeView=drafts'; + }, + } ); - return { - commands, - isLoading: false, + return { + commands, + isLoading: false, + }; }; -} export default function useCommands() { useCommandLoader( { @@ -502,11 +502,11 @@ export default function useCommands() { useCommandLoader( { name: 'core/editor/site-editor', - hook: useSiteEditorCommandLoader, + hook: getuseSiteEditorCommandLoader(), context: 'site-editor', } ); - - useCommandLoader( { + + useCommandLoader( { name: 'core/editor/page-content-focus', hook: getPageContentFocusCommands(), context: 'entity-edit',