Skip to content

Commit

Permalink
Columns: Add space above notice text (WordPress#68259)
Browse files Browse the repository at this point in the history
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Dec 25, 2024
1 parent e00a656 commit e5bc2a1
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions packages/block-library/src/columns/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ToggleControl,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
__experimentalVStack as VStack,
} from '@wordpress/components';

import {
Expand Down Expand Up @@ -166,24 +167,29 @@ function ColumnInspectorControls( {
hasValue={ () => count }
onDeselect={ () => updateColumns( count, minCount ) }
>
<RangeControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Columns' ) }
value={ count }
onChange={ ( value ) =>
updateColumns( count, Math.max( minCount, value ) )
}
min={ Math.max( 1, minCount ) }
max={ Math.max( 6, count ) }
/>
{ count > 6 && (
<Notice status="warning" isDismissible={ false }>
{ __(
'This column count exceeds the recommended amount and may cause visual breakage.'
) }
</Notice>
) }
<VStack spacing={ 4 }>
<RangeControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Columns' ) }
value={ count }
onChange={ ( value ) =>
updateColumns(
count,
Math.max( minCount, value )
)
}
min={ Math.max( 1, minCount ) }
max={ Math.max( 6, count ) }
/>
{ count > 6 && (
<Notice status="warning" isDismissible={ false }>
{ __(
'This column count exceeds the recommended amount and may cause visual breakage.'
) }
</Notice>
) }
</VStack>
</ToolsPanelItem>
) }
<ToolsPanelItem
Expand Down

0 comments on commit e5bc2a1

Please sign in to comment.