From 145d537058254294ac62c4aa0d29a13ffbdba58e Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 22 Jan 2025 22:28:04 +0400 Subject: [PATCH] Style Book: Disable the device preview button in the header --- packages/editor/src/components/header/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/components/header/index.js b/packages/editor/src/components/header/index.js index b32fda6d031b1..3a3e231259a57 100644 --- a/packages/editor/src/components/header/index.js +++ b/packages/editor/src/components/header/index.js @@ -95,11 +95,12 @@ function Header( { [ 'post', 'page', 'wp_template' ].includes( postType ) && hasSectionRootClientId; - const disablePreviewOption = [ - NAVIGATION_POST_TYPE, - TEMPLATE_PART_POST_TYPE, - PATTERN_POST_TYPE, - ].includes( postType ); + const disablePreviewOption = + [ + NAVIGATION_POST_TYPE, + TEMPLATE_PART_POST_TYPE, + PATTERN_POST_TYPE, + ].includes( postType ) || forceDisableBlockTools; const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] = useState( true );