Skip to content

Commit

Permalink
Revert slot for navigation mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Nov 22, 2024
1 parent c278257 commit 436c9b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,14 @@ export default function QueryInspectorControls( props ) {
{ hasPatterns && (
<PanelBody
title={ __( 'Design' ) }
initialOpen={ false }
className="block-library-query-toolspanel__design"
>
<PatternSelection
attributes={ attributes }
clientId={ clientId }
showTitlesAsTooltip
showSearch={ false }
/>
</PanelBody>
) }
Expand Down
21 changes: 12 additions & 9 deletions packages/block-library/src/query/edit/pattern-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function PatternSelection( {
clientId,
attributes,
showTitlesAsTooltip = false,
showSearch = true,
} ) {
const [ searchValue, setSearchValue ] = useState( '' );
const { replaceBlock, selectBlock } = useDispatch( blockEditorStore );
Expand Down Expand Up @@ -80,15 +81,17 @@ export default function PatternSelection( {
};
return (
<div className="block-library-query-pattern__selection-content">
<div className="block-library-query-pattern__selection-search">
<SearchControl
__nextHasNoMarginBottom
onChange={ setSearchValue }
value={ searchValue }
label={ __( 'Search' ) }
placeholder={ __( 'Search' ) }
/>
</div>
{ showSearch && (
<div className="block-library-query-pattern__selection-search">
<SearchControl
__nextHasNoMarginBottom
onChange={ setSearchValue }
value={ searchValue }
label={ __( 'Search' ) }
placeholder={ __( 'Search' ) }
/>
</div>
) }
<BlockContextProvider value={ blockPreviewContext }>
<BlockPatternsList
blockPatterns={ filteredBlockPatterns }
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/query/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
}

.block-library-query-toolspanel__design {
.block-library-query-pattern__selection-search {
margin-bottom: $grid-unit-20;
.block-library-query-pattern__selection-content {
margin-top: $grid-unit-10;
}
}

Expand Down

0 comments on commit 436c9b5

Please sign in to comment.