Skip to content

Commit

Permalink
Check that theme palette exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Nov 5, 2024
1 parent ccbc603 commit 373c6b2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/edit-site/src/components/style-book/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,18 @@ function getLandingBlockExamples(
( origin: ColorOrigin ) => origin.slug === 'theme'
);

const themeColorexample: BlockExample = {
name: 'theme-colors',
title: __( 'Theme Colors' ),
category: 'landing',
content: (
<ColorExamples colors={ themePalette.colors } type={ colors } />
),
};

examples.push( themeColorexample );
if ( themePalette ) {
const themeColorexample: BlockExample = {
name: 'theme-colors',
title: __( 'Theme Colors' ),
category: 'landing',
content: (
<ColorExamples colors={ themePalette.colors } type={ colors } />
),
};

examples.push( themeColorexample );
}

// Use our own example for the Heading block so that we can show multiple
// heading levels.
Expand Down

0 comments on commit 373c6b2

Please sign in to comment.