PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 2.2.0
GenerateBlocks v2.2.0
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / components / grid-column-selector / GridColumnSelector.jsx
generateblocks / src / components / grid-column-selector Last commit date
GridColumnSelector.jsx 1 year ago editor.scss 1 year ago index.js 1 year ago layouts.js 1 year ago
GridColumnSelector.jsx
32 lines
1 import classnames from 'classnames';
2 import { Button } from '@wordpress/components';
3 import { layouts } from './layouts';
4 import './editor.scss';
5
6 export function GridColumnSelector( { onClick, value } ) {
7 return (
8 <div className="gb-grid-control__grid-template-columns-rows--presets">
9 { layouts.map( ( { label, id, layout, divs } ) => {
10 return (
11 <Button
12 label={ label }
13 showTooltip={ true }
14 key={ `layout-${ id }` }
15 className="gb-grid-control__grid-template-columns-rows--presets-button"
16 onClick={ () => onClick( layout ) }
17 isPressed={ layout === value }
18 style={ { '--grid-template-columns': layout } }
19 >
20 { Array.from( { length: divs }, ( _, index ) => (
21 <div
22 key={ `layout-${ index }` }
23 className={ classnames( 'gb-preview-column' ) }
24 />
25 ) ) }
26 </Button>
27 );
28 } ) }
29 </div>
30 );
31 }
32