Skip to content

Commit

Permalink
edits based on PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Work authored and Work committed Jan 4, 2023
1 parent 62e356a commit 7a1f9d7
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 51 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/src/components/font-family/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default function FontFamilyControl( {
];
return (
<SelectControl
__nextHasNoMarginBottom
label={ __( 'Font' ) }
options={ options }
value={ value }
Expand Down
2 changes: 1 addition & 1 deletion packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Internal

- `Dashicon`: remove unnecessary type for `className` prop ([46849](https://github.com/WordPress/gutenberg/pull/46849)).
- `ColorPicker` & `QueryControls`: Replace bottom margin overrides with `__nextHasNoMarginBottom` ([#46448](https://github.com/WordPress/gutenberg/pull/46448)).

## 23.1.0 (2023-01-02)

Expand Down Expand Up @@ -42,7 +43,6 @@
- Lighten the border color on control components ([#46252](https://github.com/WordPress/gutenberg/pull/46252)).
- `Popover`: Prevent unnecessary paint when scrolling by using transform instead of top/left positionning ([#46187](https://github.com/WordPress/gutenberg/pull/46187)).
- `CircularOptionPicker`: Prevent unecessary paint on hover ([#46197](https://github.com/WordPress/gutenberg/pull/46197)).
- `ColorPicker` & `QueryControls`: Replace bottom margin overrides with `__nextHasNoMarginBottom` ([#46448](https://github.com/WordPress/gutenberg/pull/46448)).

### Experimental

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
*/
import { useSelect } from '@wordpress/data';
import { useState, useEffect } from '@wordpress/element';
import {
SelectControl,
__experimentalVStack as VStack,
} from '@wordpress/components';
import { SelectControl } from '@wordpress/components';
import { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';
import {
store as blockEditorStore,
Expand Down Expand Up @@ -171,7 +168,7 @@ export default function NavigationInspector() {
}, [ isLoadingInnerBlocks, hasLoadedInnerBlocks ] );

return (
<VStack>
<div className="edit-site-navigation-inspector">
{ hasResolvedNavigationMenus && ! hasNavigationMenus && (
<p className="edit-site-navigation-inspector__empty-msg">
{ __( 'There are no Navigation Menus.' ) }
Expand All @@ -184,6 +181,7 @@ export default function NavigationInspector() {
{ hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && (
<SelectControl
__nextHasNoMarginBottom
className="edit-site-navigation-inspector__select-menu"
aria-controls={
// aria-controls should only apply when referenced element is in DOM
hasLoadedInnerBlocks ? navMenuListId : undefined
Expand Down Expand Up @@ -220,6 +218,6 @@ export default function NavigationInspector() {
{ __( 'Navigation Menu is empty.' ) }
</p>
) }
</VStack>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
.block-editor-list-view-block__menu-cell {
padding-right: 0;
}

.edit-site-navigation-inspector__select-menu {
margin-bottom: $grid-unit-10;
}
}

.edit-site-navigation-inspector__placeholder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function EditTemplateTitle( { template } ) {

return (
<TextControl
__nextHasNoMarginBottom
label={ __( 'Title' ) }
value={ forceEmpty ? '' : title }
help={
Expand Down
4 changes: 0 additions & 4 deletions packages/edit-site/src/components/template-details/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
.edit-site-template-details__group {
margin: 0;
padding: $grid-unit-20;

.edit-site-template-details__area-select {
margin-bottom: $grid-unit-10;
}
}

.edit-site-template-details__group + .edit-site-template-details__group {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default function TemplatePartAreaSelector( { id } ) {
return (
<SelectControl
__nextHasNoMarginBottom
className="edit-site-template-details__area-select"
label={ __( 'Area' ) }
labelPosition="top"
options={ areaOptions }
Expand Down
56 changes: 29 additions & 27 deletions packages/widgets/src/blocks/legacy-widget/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
BlockIcon,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { Spinner, Placeholder } from '@wordpress/components';
import { Flex, FlexBlock, Spinner, Placeholder } from '@wordpress/components';
import { brush as brushIcon } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { useState, useCallback } from '@wordpress/element';
Expand Down Expand Up @@ -57,32 +57,34 @@ function Empty( { attributes: { id, idBase }, setAttributes } ) {
icon={ <BlockIcon icon={ brushIcon } /> }
label={ __( 'Legacy Widget' ) }
>
<div className="wp-block-legacy-widget__selector-container">
<WidgetTypeSelector
selectedId={ id ?? idBase }
onSelect={ ( { selectedId, isMulti } ) => {
if ( ! selectedId ) {
setAttributes( {
id: null,
idBase: null,
instance: null,
} );
} else if ( isMulti ) {
setAttributes( {
id: null,
idBase: selectedId,
instance: {},
} );
} else {
setAttributes( {
id: selectedId,
idBase: null,
instance: null,
} );
}
} }
/>
</div>
<Flex>
<FlexBlock>
<WidgetTypeSelector
selectedId={ id ?? idBase }
onSelect={ ( { selectedId, isMulti } ) => {
if ( ! selectedId ) {
setAttributes( {
id: null,
idBase: null,
instance: null,
} );
} else if ( isMulti ) {
setAttributes( {
id: null,
idBase: selectedId,
instance: {},
} );
} else {
setAttributes( {
id: selectedId,
idBase: null,
instance: null,
} );
}
} }
/>
</FlexBlock>
</Flex>
</Placeholder>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default function WidgetTypeSelector( { selectedId, onSelect } ) {
return (
<SelectControl
__nextHasNoMarginBottom
className="wp-block-legacy-widget__select-widget"
label={ __( 'Select a legacy widget to display:' ) }
value={ selectedId ?? '' }
options={ [
Expand Down
10 changes: 0 additions & 10 deletions packages/widgets/src/blocks/legacy-widget/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,3 @@
min-width: 400px;
}

.wp-block-legacy-widget {
.wp-block-legacy-widget__selector-container {
width: 100%;
}

// Replaces margin on BaseControl
.wp-block-legacy-widget__select-widget {
margin-bottom: $grid-unit-10;
}
}

1 comment on commit 7a1f9d7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3835011811
📝 Reported issues:

Please sign in to comment.