Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Switch ToggleButtonControl for ToggleGroupControl
Browse files Browse the repository at this point in the history
See #5967
  • Loading branch information
sunyatasattva committed Apr 11, 2022
1 parent 051759e commit 8f5ca39
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions assets/js/blocks/featured-product/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ import {
ToggleControl,
ToolbarGroup,
withSpokenMessages,
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
} from '@wordpress/components';
import classnames from 'classnames';
import { Component } from '@wordpress/element';
import { compose, createHigherOrderComponent } from '@wordpress/compose';
import { isEmpty } from 'lodash';
import PropTypes from 'prop-types';
import ProductControl from '@woocommerce/editor-components/product-control';
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
import { withProduct } from '@woocommerce/block-hocs';
Expand Down Expand Up @@ -274,7 +275,7 @@ const FeaturedProduct = ( {
'woo-gutenberg-products-block'
) }
>
<ToggleButtonControl
<ToggleGroupControl
help={
<>
<p>
Expand All @@ -296,29 +297,28 @@ const FeaturedProduct = ( {
'woo-gutenberg-products-block'
) }
value={ attributes.imageFit }
options={ [
{
label: __(
'None',
'woo-gutenberg-products-block'
),
value: 'none',
},
{
/* translators: "Cover" is a verb that indicates an image covering the entire container. */
label: __(
'Cover',
'woo-gutenberg-products-block'
),
value: 'cover',
},
] }
onChange={ ( value ) =>
setAttributes( {
imageFit: value,
} )
}
/>
>
<ToggleGroupControlOption
label={ __(
'None',
'woo-gutenberg-products-block'
) }
value="none"
/>
<ToggleGroupControlOption
/* translators: "Cover" is a verb that indicates an image covering the entire container. */
label={ __(
'Cover',
'woo-gutenberg-products-block'
) }
value="cover"
/>
</ToggleGroupControl>
<FocalPointPicker
label={ __(
'Focal Point Picker',
Expand Down

0 comments on commit 8f5ca39

Please sign in to comment.