Skip to content

Commit 889b716

Browse files
authored
Update the position of the patterns tab in the inserter menu (#55688)
* Move the patterns tab after the blocks tab in the inserter menu * Remove left-over 'prioritizePatterns' * Update spacing in tab.js
1 parent 30e0d29 commit 889b716

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

packages/block-editor/src/components/inserter/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ class PrivateInserter extends Component {
186186
clientId={ clientId }
187187
isAppender={ isAppender }
188188
showInserterHelpPanel={ showInserterHelpPanel }
189-
prioritizePatterns={ prioritizePatterns }
190189
/>
191190
);
192191
}

packages/block-editor/src/components/inserter/library.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,13 @@ function InserterLibrary(
2626
},
2727
ref
2828
) {
29-
const { destinationRootClientId, prioritizePatterns } = useSelect(
29+
const { destinationRootClientId } = useSelect(
3030
( select ) => {
31-
const { getBlockRootClientId, getSettings } =
32-
select( blockEditorStore );
33-
31+
const { getBlockRootClientId } = select( blockEditorStore );
3432
const _rootClientId =
3533
rootClientId || getBlockRootClientId( clientId ) || undefined;
3634
return {
3735
destinationRootClientId: _rootClientId,
38-
prioritizePatterns:
39-
getSettings().__experimentalPreferPatternsOnRoot &&
40-
! _rootClientId,
4136
};
4237
},
4338
[ clientId, rootClientId ]
@@ -54,7 +49,6 @@ function InserterLibrary(
5449
__experimentalInsertionIndex={ __experimentalInsertionIndex }
5550
__experimentalFilterValue={ __experimentalFilterValue }
5651
shouldFocusBlock={ shouldFocusBlock }
57-
prioritizePatterns={ prioritizePatterns }
5852
ref={ ref }
5953
/>
6054
);

packages/block-editor/src/components/inserter/menu.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ function InserterMenu(
4545
showMostUsedBlocks,
4646
__experimentalFilterValue = '',
4747
shouldFocusBlock = true,
48-
prioritizePatterns,
4948
},
5049
ref
5150
) {
@@ -258,7 +257,6 @@ function InserterMenu(
258257
<InserterTabs
259258
showPatterns={ showPatterns }
260259
showMedia={ showMedia }
261-
prioritizePatterns={ prioritizePatterns }
262260
onSelect={ handleSetSelectedTab }
263261
tabsContents={ inserterTabsContents }
264262
/>

packages/block-editor/src/components/inserter/tabs.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ function InserterTabs( {
3232
showPatterns = false,
3333
showMedia = false,
3434
onSelect,
35-
prioritizePatterns = false,
3635
tabsContents,
3736
} ) {
3837
const tabs = [
39-
prioritizePatterns && showPatterns && patternsTab,
4038
blocksTab,
41-
! prioritizePatterns && showPatterns && patternsTab,
39+
showPatterns && patternsTab,
4240
showMedia && mediaTab,
4341
].filter( Boolean );
4442

0 commit comments

Comments
 (0)