Skip to content

Commit

Permalink
Update: Use util getVariationClassName instead of computing the varia…
Browse files Browse the repository at this point in the history
…tion inline. (#60664)

Co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people committed Apr 11, 2024
1 parent af22262 commit d8215e9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { getBlockType, getBlockFromExample } from '@wordpress/blocks';
import { __experimentalSpacer as Spacer } from '@wordpress/components';
import { useMemo } from '@wordpress/element';

/**
* Internal dependencies
*/
import { getVariationClassName } from './utils';

const BlockPreviewPanel = ( { name, variation = '' } ) => {
const blockExample = getBlockType( name )?.example;
const blocks = useMemo( () => {
Expand All @@ -19,7 +24,7 @@ const BlockPreviewPanel = ( { name, variation = '' } ) => {
...example,
attributes: {
...example.attributes,
className: 'is-style-' + variation,
className: getVariationClassName( variation ),
},
};
}
Expand Down

1 comment on commit d8215e9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d8215e9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8645940515
📝 Reported issues:

Please sign in to comment.