← All changes
|
includes/frontend/blocks/src/post-count/components/unit-control.js
+14
-14
4.3.2
→
4.5.1
View file →
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | import { TextControl, SelectControl } from '@wordpress/components'; |
| 2 | 2 | import { __ } from '@wordpress/i18n'; |
| 3 | 3 | |
| 4 | -const UnitControl = ({ | |
| 4 | +const UnitControl = ( { | |
| 5 | 5 | label, |
| 6 | 6 | value, |
| 7 | 7 | unit = 'px', |
| 8 | 8 | onValueChange, |
| @@ -13,30 +13,30 @@ | ||
| 13 | 13 | { label: '%', value: '%' }, |
| 14 | 14 | { label: 'rem', value: 'rem' }, |
| 15 | 15 | ], |
| 16 | 16 | style = {}, |
| 17 | -}) => { | |
| 17 | +} ) => { | |
| 18 | 18 | return ( |
| 19 | - <div className="unit-control" style={style}> | |
| 20 | - <div style={{ display: 'flex' }}> | |
| 19 | + <div className="unit-control" style={ style }> | |
| 20 | + <div style={ { display: 'flex' } }> | |
| 21 | 21 | <TextControl |
| 22 | - label={label} | |
| 22 | + label={ label } | |
| 23 | 23 | __nextHasNoMarginBottom |
| 24 | 24 | type="number" |
| 25 | - value={value} | |
| 26 | - onChange={onValueChange} | |
| 27 | - style={{ | |
| 25 | + value={ value } | |
| 26 | + onChange={ onValueChange } | |
| 27 | + style={ { | |
| 28 | 28 | flexGrow: 1, |
| 29 | 29 | marginBottom: 0, |
| 30 | - }} | |
| 30 | + } } | |
| 31 | 31 | /> |
| 32 | 32 | <SelectControl |
| 33 | - label={__('Unit', 'top-10')} | |
| 33 | + label={ __( 'Unit', 'top-10' ) } | |
| 34 | 34 | __nextHasNoMarginBottom |
| 35 | - value={unit} | |
| 36 | - options={options} | |
| 37 | - onChange={onUnitChange} | |
| 38 | - style={{ width: 'max-content', marginBottom: 0 }} | |
| 35 | + value={ unit } | |
| 36 | + options={ options } | |
| 37 | + onChange={ onUnitChange } | |
| 38 | + style={ { width: 'max-content', marginBottom: 0 } } | |
| 39 | 39 | /> |
| 40 | 40 | </div> |
| 41 | 41 | </div> |
| 42 | 42 | ); |