From 373c6b2b18b82092e3dfdaa5e733927261e68e62 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 29 Oct 2024 15:56:45 +1100 Subject: [PATCH] Check that theme palette exists --- .../src/components/style-book/examples.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/edit-site/src/components/style-book/examples.tsx b/packages/edit-site/src/components/style-book/examples.tsx index 0429ec1461b416..f26f283ffa4477 100644 --- a/packages/edit-site/src/components/style-book/examples.tsx +++ b/packages/edit-site/src/components/style-book/examples.tsx @@ -78,16 +78,18 @@ function getLandingBlockExamples( ( origin: ColorOrigin ) => origin.slug === 'theme' ); - const themeColorexample: BlockExample = { - name: 'theme-colors', - title: __( 'Theme Colors' ), - category: 'landing', - content: ( - - ), - }; - - examples.push( themeColorexample ); + if ( themePalette ) { + const themeColorexample: BlockExample = { + name: 'theme-colors', + title: __( 'Theme Colors' ), + category: 'landing', + content: ( + + ), + }; + + examples.push( themeColorexample ); + } // Use our own example for the Heading block so that we can show multiple // heading levels.