Skip to content

Commit

Permalink
refactor: revert usage of clearable prop
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Feb 3, 2025
1 parent 1ec75a0 commit 1c61404
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const LabeledColorIndicator = ( { indicator, label } ) => (
);

const renderToggle =
( duotone, resetDuotone, clearable ) =>
( duotone, resetDuotone ) =>
( { onToggle, isOpen } ) => {
const toggleProps = {
onClick: onToggle,
Expand All @@ -140,7 +140,7 @@ const renderToggle =
label={ __( 'Duotone' ) }
/>
</Item>
{ clearable && duotone && (
{ duotone && (
<Button
__next40pxDefaultSize
label={ __( 'Reset' ) }
Expand All @@ -162,7 +162,6 @@ export default function FiltersPanel( {
settings,
panelId,
defaultControls = DEFAULT_CONTROLS,
clearable = false,
} ) {
const decodeValue = ( rawValue ) =>
getValueFromVariable( { settings }, '', rawValue );
Expand Down Expand Up @@ -220,11 +219,7 @@ export default function FiltersPanel( {
<Dropdown
popoverProps={ popoverProps }
className="block-editor-global-styles-filters-panel__dropdown"
renderToggle={ renderToggle(
duotone,
resetDuotone,
clearable
) }
renderToggle={ renderToggle( duotone, resetDuotone ) }
renderContent={ () => (
<DropdownContentWrapper paddingSize="small">
<MenuGroup label={ __( 'Duotone' ) }>
Expand Down
5 changes: 3 additions & 2 deletions packages/block-editor/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@
top: $grid-unit;
margin: auto $grid-unit auto;
opacity: 0;
transition: opacity 0.1s ease-in-out;
@include reduce-motion("transition");
@media not (prefers-reduced-motion) {
transition: opacity 0.1s ease-in-out;
}

.block-editor-panel-duotone-settings__dropdown:hover + &,
&:focus,
Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/src/hooks/duotone.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ function DuotonePanelPure( { style, setAttributes, name } ) {
setAttributes( { style: newStyle } );
} }
settings={ settings }
clearable
/>
</InspectorControls>
<BlockControls group="block" __experimentalShareWithChildBlocks>
Expand Down

0 comments on commit 1c61404

Please sign in to comment.