Skip to content

Commit

Permalink
feat: add DEFAULT_HEIGHT constant for spacer component
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Mar 6, 2025
1 parent 2316c71 commit 0cf86d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/block-library/src/spacer/constants.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const MIN_SPACER_SIZE = 0;
export const DEFAULT_HEIGHT = '100px';
2 changes: 1 addition & 1 deletion packages/block-library/src/spacer/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
*/
import { unlock } from '../lock-unlock';
import SpacerControls from './controls';
import { MIN_SPACER_SIZE } from './constants';
import { DEFAULT_HEIGHT, MIN_SPACER_SIZE } from './constants';

const { useSpacingSizes } = unlock( blockEditorPrivateApis );

Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/spacer/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*/
import { useBlockProps, getSpacingPresetCssVar } from '@wordpress/block-editor';

/**
* Internal dependencies
*/
import { DEFAULT_HEIGHT } from './constants';

export default function save( { attributes } ) {
const { height = DEFAULT_HEIGHT, width, style } = attributes;
const { layout: { selfStretch } = {} } = style || {};
Expand Down

0 comments on commit 0cf86d1

Please sign in to comment.