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

Tweak Media & Text inspector controls #58447

Merged
merged 3 commits into from
Feb 5, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 10 additions & 11 deletions packages/block-library/src/media-text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ function MediaTextEdit( { attributes, isSelected, setAttributes } ) {

const mediaTextGeneralSettings = (
<PanelBody title={ __( 'Settings' ) }>
<RangeControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Media width' ) }
value={ temporaryMediaWidth || mediaWidth }
onChange={ commitWidthChange }
min={ WIDTH_CONSTRAINT_PERCENTAGE }
max={ 100 - WIDTH_CONSTRAINT_PERCENTAGE }
/>
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Stack on mobile' ) }
Expand All @@ -243,7 +252,7 @@ function MediaTextEdit( { attributes, isSelected, setAttributes } ) {
{ mediaType === 'image' && (
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Crop image to fill entire column' ) }
label={ __( 'Crop image to fill' ) }
checked={ !! imageFill }
onChange={ () =>
setAttributes( {
Expand Down Expand Up @@ -293,16 +302,6 @@ function MediaTextEdit( { attributes, isSelected, setAttributes } ) {
) }
/>
) }
{ mediaUrl && (
<RangeControl
__nextHasNoMarginBottom
label={ __( 'Media width' ) }
value={ temporaryMediaWidth || mediaWidth }
onChange={ commitWidthChange }
min={ WIDTH_CONSTRAINT_PERCENTAGE }
max={ 100 - WIDTH_CONSTRAINT_PERCENTAGE }
/>
) }
</PanelBody>
);

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/media-text/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class MediaTextEdit extends Component {
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<ToggleControl
label={ __( 'Crop image to fill entire column' ) }
label={ __( 'Crop image to fill' ) }
checked={ imageFill }
onChange={ this.onSetImageFill }
/>
Expand Down