@@ -14,15 +14,19 @@ import { useEffect } from '@wordpress/element';
14
14
*/
15
15
import useSetting from '../components/use-setting' ;
16
16
17
- function helpText ( selfStretch ) {
18
- switch ( selfStretch ) {
19
- case 'fill' :
20
- return __ ( 'Stretch to fill available space.' ) ;
21
- case 'fixed' :
17
+ function helpText ( selfStretch , parentLayout ) {
18
+ const { orientation = 'horizontal' } = parentLayout ;
19
+
20
+ if ( selfStretch === 'fill' ) {
21
+ return __ ( 'Stretch to fill available space.' ) ;
22
+ }
23
+ if ( selfStretch === 'fixed' ) {
24
+ if ( orientation === 'horizontal' ) {
22
25
return __ ( 'Specify a fixed width.' ) ;
23
- default :
24
- return __ ( 'Fit contents .' ) ;
26
+ }
27
+ return __ ( 'Specify a fixed height .' ) ;
25
28
}
29
+ return __ ( 'Fit contents.' ) ;
26
30
}
27
31
28
32
/**
@@ -64,7 +68,7 @@ export function ChildLayoutEdit( {
64
68
size = { '__unstable-large' }
65
69
label = { childLayoutOrientation ( parentLayout ) }
66
70
value = { selfStretch || 'fit' }
67
- help = { helpText ( selfStretch ) }
71
+ help = { helpText ( selfStretch , parentLayout ) }
68
72
onChange = { ( value ) => {
69
73
const newFlexSize = value !== 'fixed' ? null : flexSize ;
70
74
setAttributes ( {
0 commit comments