Skip to content

Commit

Permalink
Tweaking widths. Ensure expansion on mobile
Browse files Browse the repository at this point in the history
bad robot
  • Loading branch information
ramonjd committed Nov 26, 2024
1 parent 74a4423 commit 5797f50
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import StickyControl from './sticky-control';
import PerPageControl from './per-page-control';
import OffsetControl from './offset-controls';
import PagesControl from './pages-control';
import { unlock } from '../../../lock-unlock';
import {
usePostTypes,
useIsPostTypeHierarchical,
Expand Down Expand Up @@ -174,22 +173,19 @@ export default function QueryInspectorControls( props ) {
showParentControl ||
showFormatControl;
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

const showPostCountControl = isControlAllowed(
allowedControls,
'postCount'
);
const showOffSetControl = isControlAllowed( allowedControls, 'offset' );
const showPagesControl = isControlAllowed( allowedControls, 'pages' );

const showDisplayPanel =
showPostCountControl || showOffSetControl || showPagesControl;

return (
<>
{ !! postType && (
<BlockInfo>
<CreateNewPostLink postType={ postType } />
</BlockInfo>
) }
{ showSettingsPanel && (
<PanelBody title={ __( 'Settings' ) }>
{ showInheritControl && (
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/query/edit/query-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function QueryToolbar( { clientId, attributes } ) {
<Dropdown
contentClassName="block-editor-block-settings-menu__popover"
focusOnMount="firstElement"
expandOnMobile
renderToggle={ ( { isOpen, onToggle } ) => (
<ToolbarButton
aria-haspopup="true"
Expand All @@ -40,6 +41,7 @@ export default function QueryToolbar( { clientId, attributes } ) {
clientId={ clientId }
attributes={ attributes }
showSearch={ false }
showTitlesAsTooltip
/>
) }
/>
Expand Down
22 changes: 21 additions & 1 deletion packages/block-library/src/query/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,25 @@
}

.block-editor-block-settings-menu__popover {
min-width: 500px;
&.is-expanded {
overflow-y: scroll;
}
.block-library-query-pattern__selection-content {
height: 100%;
}
.block-editor-block-patterns-list {
display: grid;
grid-template-columns: 1fr;
@include break-small() {
grid-template-columns: 1fr 1fr;
}
grid-gap: $grid-unit-15;
min-width: $break-zoomed-in;
@include break-small() {
min-width: $break-mobile;
}
}
.block-editor-block-patterns-list__list-item {
margin-bottom: 0;
}
}

0 comments on commit 5797f50

Please sign in to comment.