Fix editor header hidden in Firefox (#38247)

* Update page config to add support for layout header/footer

* Fix lint error
This commit is contained in:
louwie17 2023-05-18 13:00:42 -03:00 committed by GitHub
parent 5d6b3d5ceb
commit 2843fbb7a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 17 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Remove css unrelated to the product block editor.

View File

@ -101,9 +101,3 @@
display: none; // use important or increase specificity.
}
}
.woocommerce-layout:has( .woocommerce-product-block-editor ) {
.woocommerce-layout__header {
display: none;
}
}

View File

@ -182,6 +182,9 @@ export const getPages = () => {
navArgs: {
id: 'woocommerce-add-product',
},
layout: {
header: false,
},
wpOpenMenu: 'menu-posts-product',
capability: 'manage_woocommerce',
} );
@ -196,6 +199,9 @@ export const getPages = () => {
navArgs: {
id: 'woocommerce-edit-product',
},
layout: {
header: false,
},
wpOpenMenu: 'menu-posts-product',
capability: 'manage_woocommerce',
} );

View File

@ -185,7 +185,8 @@ function _Layout( {
);
}
const { breadcrumbs } = page;
const { breadcrumbs, layout = { header: true, footer: true } } = page;
const { header: showHeader = true, footer: showFooter = true } = layout;
const query = Object.fromEntries(
new URLSearchParams( location && location.search )
@ -199,15 +200,17 @@ function _Layout( {
>
<SlotFillProvider>
<div className="woocommerce-layout">
<Header
sections={
isFunction( breadcrumbs )
? breadcrumbs( { match } )
: breadcrumbs
}
isEmbedded={ isEmbedded }
query={ query }
/>
{ showHeader && (
<Header
sections={
isFunction( breadcrumbs )
? breadcrumbs( { match } )
: breadcrumbs
}
isEmbedded={ isEmbedded }
query={ query }
/>
) }
<TransientNotices />
{ ! isEmbedded && (
<PrimaryLayout>
@ -226,7 +229,7 @@ function _Layout( {
<WCPayUsageModal />
</Suspense>
) }
<Footer />
{ showFooter && <Footer /> }
<CustomerEffortScoreModalContainer />
</div>
<PluginArea scope="woocommerce-admin" />

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Add support for `showHeader` config in router config to hide header if needed.