From cdf5af954672822306dbd2ae427f8251254f1333 Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 14 Mar 2024 15:18:02 +1100 Subject: [PATCH] Filtering for settings before showing titles. --- .../sidebar-navigation-screen-global-styles/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js index c28f5220c6fe6..d9dc57ffae1e6 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js @@ -77,11 +77,14 @@ function SidebarNavigationScreenGlobalStylesContent() { const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( { property: 'color', + filter: ( variation ) => !! variation?.settings?.color, } ); const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( { property: 'typography', + filter: ( variation ) => + !! variation?.settings?.typography?.fontFamilies, } ); // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are @@ -100,7 +103,7 @@ function SidebarNavigationScreenGlobalStylesContent() { className="edit-site-global-styles-variation-container" > - { colorVariations && ( + { colorVariations?.length && (

{ __( 'Colors' ) } @@ -108,7 +111,7 @@ function SidebarNavigationScreenGlobalStylesContent() {

) } - { typographyVariations && ( + { typographyVariations?.length && (

{ __( 'Typography' ) }