Skip to content

Commit d22493d

Browse files
committed
Update gallery default columns for desktop and add tooltips
1 parent 1fd9cf3 commit d22493d

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

plugin/assets/src/block-editor/blocks/image-list/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"columns": {
6767
"type": "object",
6868
"default": {
69-
"desktop": 4,
69+
"desktop": 5,
7070
"tablet": 3,
7171
"mobile": 1
7272
}

plugin/assets/src/block-editor/components/layout-controls/index.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import classNames from 'classnames';
2222
/**
2323
* WordPress dependencies
2424
*/
25-
import { BaseControl, RangeControl } from '@wordpress/components';
25+
import { BaseControl, RangeControl, Tooltip } from '@wordpress/components';
2626
import { useState } from '@wordpress/element';
2727
import { __ } from '@wordpress/i18n';
2828

@@ -59,15 +59,16 @@ export default ( {
5959
{ label }
6060
<div className="components-base-control__label-actions components-base-control__layout-controls">
6161
{ DEVICES.map( device => (
62-
<button
63-
key={ device.name }
64-
className={ classNames( '', {
65-
'is-selected': device.name === selectedDevice,
66-
} ) }
67-
onClick={ () => setSelectedDevice( device.name ) }
68-
>
69-
<i className="material-icons">{ device.icon }</i>
70-
</button>
62+
<Tooltip text={ device.label } key={ device.name }>
63+
<button
64+
className={ classNames( '', {
65+
'is-selected': device.name === selectedDevice,
66+
} ) }
67+
onClick={ () => setSelectedDevice( device.name ) }
68+
>
69+
<i className="material-icons">{ device.icon }</i>
70+
</button>
71+
</Tooltip>
7172
) ) }
7273
</div>
7374
</BaseControl.VisualLabel>

plugin/assets/src/block-editor/constants.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17+
/**
18+
* WordPress dependencies
19+
*/
20+
import { __ } from '@wordpress/i18n';
21+
1722
const NAMESPACE = '/wp/v2';
1823
export const ENDPOINTS = {
1924
root: NAMESPACE,
@@ -24,13 +29,16 @@ export const DEVICES = [
2429
{
2530
name: 'desktop',
2631
icon: 'computer',
32+
label: __( 'Layout Settings for Desktop', 'material-design' ),
2733
},
2834
{
2935
name: 'tablet',
3036
icon: 'tablet',
37+
label: __( 'Layout Settings for Tablet', 'material-design' ),
3138
},
3239
{
3340
name: 'mobile',
3441
icon: 'smartphone',
42+
label: __( 'Layout Settings for Mobile', 'material-design' ),
3543
},
3644
];

0 commit comments

Comments
 (0)