Skip to content

Commit

Permalink
Fix inline block declaration in global styles ui (#47374)
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan authored Jan 24, 2023
1 parent 8014a85 commit 1c2827f
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions packages/edit-site/src/components/global-styles/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ function BlockStyleVariationsScreens( { name } ) {
) );
}

function BlockStylesNavigationScreens( {
parentMenu,
blockStyles,
blockName,
} ) {
return blockStyles.map( ( style, index ) => (
<GlobalStylesNavigationScreen
key={ index }
path={ parentMenu + '/variations/' + style.name }
>
<ScreenVariation blockName={ blockName } style={ style } />
</GlobalStylesNavigationScreen>
) );
}

function ContextScreens( { name, parentMenu = '' } ) {
const hasVariationPath = parentMenu.search( 'variations' );
const variationPath =
Expand All @@ -89,17 +104,6 @@ function ContextScreens( { name, parentMenu = '' } ) {
[ name ]
);

const BlockStylesNavigationScreens = ( { blockStyles, blockName } ) => {
return blockStyles.map( ( style, index ) => (
<GlobalStylesNavigationScreen
key={ index }
path={ parentMenu + '/variations/' + style.name }
>
<ScreenVariation blockName={ blockName } style={ style } />
</GlobalStylesNavigationScreen>
) );
};

return (
<>
<GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>
Expand Down Expand Up @@ -198,6 +202,7 @@ function ContextScreens( { name, parentMenu = '' } ) {

{ !! blockStyleVariations?.length && (
<BlockStylesNavigationScreens
parentMenu={ parentMenu }
blockStyles={ blockStyleVariations }
blockName={ name }
/>
Expand Down

1 comment on commit 1c2827f

@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 1c2827f.
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/3994037561
📝 Reported issues:

Please sign in to comment.