Skip to content

Commit

Permalink
Update the position of the patterns tab in the inserter menu (#55688)
Browse files Browse the repository at this point in the history
* Move the patterns tab after the blocks tab in the inserter menu

* Remove left-over 'prioritizePatterns'

* Update spacing in tab.js
  • Loading branch information
carolinan authored Jan 4, 2024
1 parent 30e0d29 commit 889b716
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/src/components/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ class PrivateInserter extends Component {
clientId={ clientId }
isAppender={ isAppender }
showInserterHelpPanel={ showInserterHelpPanel }
prioritizePatterns={ prioritizePatterns }
/>
);
}
Expand Down
10 changes: 2 additions & 8 deletions packages/block-editor/src/components/inserter/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ function InserterLibrary(
},
ref
) {
const { destinationRootClientId, prioritizePatterns } = useSelect(
const { destinationRootClientId } = useSelect(
( select ) => {
const { getBlockRootClientId, getSettings } =
select( blockEditorStore );

const { getBlockRootClientId } = select( blockEditorStore );
const _rootClientId =
rootClientId || getBlockRootClientId( clientId ) || undefined;
return {
destinationRootClientId: _rootClientId,
prioritizePatterns:
getSettings().__experimentalPreferPatternsOnRoot &&
! _rootClientId,
};
},
[ clientId, rootClientId ]
Expand All @@ -54,7 +49,6 @@ function InserterLibrary(
__experimentalInsertionIndex={ __experimentalInsertionIndex }
__experimentalFilterValue={ __experimentalFilterValue }
shouldFocusBlock={ shouldFocusBlock }
prioritizePatterns={ prioritizePatterns }
ref={ ref }
/>
);
Expand Down
2 changes: 0 additions & 2 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function InserterMenu(
showMostUsedBlocks,
__experimentalFilterValue = '',
shouldFocusBlock = true,
prioritizePatterns,
},
ref
) {
Expand Down Expand Up @@ -258,7 +257,6 @@ function InserterMenu(
<InserterTabs
showPatterns={ showPatterns }
showMedia={ showMedia }
prioritizePatterns={ prioritizePatterns }
onSelect={ handleSetSelectedTab }
tabsContents={ inserterTabsContents }
/>
Expand Down
4 changes: 1 addition & 3 deletions packages/block-editor/src/components/inserter/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ function InserterTabs( {
showPatterns = false,
showMedia = false,
onSelect,
prioritizePatterns = false,
tabsContents,
} ) {
const tabs = [
prioritizePatterns && showPatterns && patternsTab,
blocksTab,
! prioritizePatterns && showPatterns && patternsTab,
showPatterns && patternsTab,
showMedia && mediaTab,
].filter( Boolean );

Expand Down

0 comments on commit 889b716

Please sign in to comment.