Skip to content

Commit

Permalink
Progress Bar: Adjusted bar height control placement and labels
Browse files Browse the repository at this point in the history
- Moved bar height control outside the conditional block to make it available for all progress bar types
- Simplified "Progress bar height" label to "Bar height"
  • Loading branch information
Infinite-Null committed Jan 27, 2025
1 parent cd80082 commit 514375f
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions packages/block-library/src/progress-bar/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,30 @@ export default function Edit( { attributes, setAttributes } ) {
}
/>
</ToolsPanelItem>
<ToolsPanelItem
label={ __( 'Progress bar height' ) }
isShownByDefault
hasValue={ () => height !== 11 }
onDeselect={ () =>
setAttributes( { height: 11 } )
}
>
<RangeControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Progress bar height' ) }
help={ __( 'Height in pixels' ) }
value={ height }
onChange={ ( heightValue ) =>
setAttributes( { height: heightValue } )
}
min={ 1 }
max={ 30 }
/>
</ToolsPanelItem>
</>
) }
<ToolsPanelItem
label={ __( 'Bar height' ) }
isShownByDefault
hasValue={ () => height !== 11 }
onDeselect={ () => setAttributes( { height: 11 } ) }
>
<RangeControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Bar height' ) }
help={ __( 'Height in pixels' ) }
value={ height }
onChange={ ( heightValue ) =>
setAttributes( { height: heightValue } )
}
min={ 1 }
max={ 30 }
/>
</ToolsPanelItem>

{ ! isReadProgress && (
<>
<ToolsPanelItem
label={ __( 'Show value' ) }
isShownByDefault
Expand Down

0 comments on commit 514375f

Please sign in to comment.