Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions packages/global-styles-ui/src/global-styles-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getBlockTypes, store as blocksStore } from '@wordpress/blocks';
import { useSelect } from '@wordpress/data';
// @ts-expect-error: Not typed yet.
import { BlockEditorProvider } from '@wordpress/block-editor';
import { useMemo, useEffect } from '@wordpress/element';
import { useMemo, useEffect, Fragment } from '@wordpress/element';
import { usePrevious } from '@wordpress/compose';
import {
generateGlobalStyles,
Expand Down Expand Up @@ -235,26 +235,23 @@ export function GlobalStylesUI( {
<ScreenBlockList />
</GlobalStylesNavigationScreen>
{ blocks.map( ( block: BlockType ) => (
<GlobalStylesNavigationScreen
key={ 'menu-block-' + block.name }
path={
'/blocks/' + encodeURIComponent( block.name )
}
>
<ScreenBlock name={ block.name } />
</GlobalStylesNavigationScreen>
) ) }

<ContextScreens />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removing this component is the actual fix.


{ blocks.map( ( block: BlockType ) => (
<ContextScreens
key={ 'screens-block-' + block.name }
name={ block.name }
parentMenu={
'/blocks/' + encodeURIComponent( block.name )
}
/>
<Fragment key={ block.name }>
<GlobalStylesNavigationScreen
path={
'/blocks/' +
encodeURIComponent( block.name )
}
>
<ScreenBlock name={ block.name } />
</GlobalStylesNavigationScreen>
<ContextScreens
name={ block.name }
parentMenu={
'/blocks/' +
encodeURIComponent( block.name )
}
/>
</Fragment>
Comment on lines +238 to +254

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A slight code quality improvement.

) ) }
</Navigator>
</BlockEditorProvider>
Expand Down
Loading