Skip to content

Commit

Permalink
Updates based on PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brookewp committed Jan 27, 2023
1 parent ffeb9da commit 25e09c9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
SelectControl,
__experimentalNumberControl as NumberControl,
__experimentalHStack as HStack,
__experimentalVStack as VStack,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';

Expand Down Expand Up @@ -47,11 +46,12 @@ export default function ImageSizeControl( {
/>
) }
{ isResizable && (
<VStack className="block-editor-image-size-control" spacing="0">
<div className="block-editor-image-size-control">
<p>{ __( 'Image dimensions' ) }</p>

<HStack align="baseline" spacing="3">
<NumberControl
className="block-editor-image-size-control__width"
label={ __( 'Width' ) }
value={ currentWidth }
min={ 1 }
Expand All @@ -60,6 +60,7 @@ export default function ImageSizeControl( {
}
/>
<NumberControl
className="block-editor-image-size-control__height"
label={ __( 'Height' ) }
value={ currentHeight }
min={ 1 }
Expand Down Expand Up @@ -106,7 +107,7 @@ export default function ImageSizeControl( {
{ __( 'Reset' ) }
</Button>
</HStack>
</VStack>
</div>
) }
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.block-editor-image-size-control {
margin-bottom: 1em;

.block-editor-image-size-control__width,
.block-editor-image-size-control__height {
margin-bottom: 1.115em;
}
}
28 changes: 18 additions & 10 deletions packages/editor/src/components/page-attributes/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __experimentalNumberControl as NumberControl } from '@wordpress/components';
import {
Flex,
FlexBlock,
__experimentalNumberControl as NumberControl,
} from '@wordpress/components';
import { withSelect, withDispatch } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { useState } from '@wordpress/element';
Expand All @@ -25,15 +29,19 @@ export const PageAttributesOrder = ( { onUpdateOrder, order = 0 } ) => {
};
const value = orderInput === null ? order : orderInput;
return (
<NumberControl
label={ __( 'Order' ) }
value={ value }
onChange={ setUpdatedOrder }
labelPosition="side"
onBlur={ () => {
setOrderInput( null );
} }
/>
<Flex>
<FlexBlock>
<NumberControl
label={ __( 'Order' ) }
value={ value }
onChange={ setUpdatedOrder }
labelPosition="side"
onBlur={ () => {
setOrderInput( null );
} }
/>
</FlexBlock>
</Flex>
);
};

Expand Down

0 comments on commit 25e09c9

Please sign in to comment.