From a411f333ae717961749714064b35c373f2f0b6c1 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Fri, 24 Jan 2025 10:29:16 +0400 Subject: [PATCH] Style Book: Disable the device preview button in the header (#68841) Co-authored-by: Mamaduka Co-authored-by: t-hamano Co-authored-by: shimotmk --- 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 b32fda6d031b14..3a3e231259a57b 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 );