Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the position of the patterns tab in the inserter menu #55688

Merged
merged 6 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
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
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
Loading