Skip to content

Commit

Permalink
id instead of widgetAreaId + lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed May 22, 2019
1 parent fd920f2 commit 4f2c6cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/edit-widgets/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { withDispatch } from '@wordpress/data';


function Header( { saveWidgetAreas } ) {
return (
<div
Expand Down
10 changes: 5 additions & 5 deletions packages/edit-widgets/src/components/widget-area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ function WidgetArea( {
}

export default compose( [
withSelect( ( select, { widgetAreaId } ) => {
withSelect( ( select, { id } ) => {
const {
getBlocksFromWidgetArea,
getWidgetArea,
} = select( 'core/edit-widgets' );
const blocks = getBlocksFromWidgetArea( widgetAreaId );
const widgetAreaName = ( getWidgetArea( widgetAreaId ) || {} ).name;
const blocks = getBlocksFromWidgetArea( id );
const widgetAreaName = ( getWidgetArea( id ) || {} ).name;
return {
blocks,
widgetAreaName,
};
} ),
withDispatch( ( dispatch, { widgetAreaId } ) => {
withDispatch( ( dispatch, { id } ) => {
return {
updateBlocks( blocks ) {
const { updateBlocksInWidgetArea } = dispatch( 'core/edit-widgets' );
updateBlocksInWidgetArea( widgetAreaId, blocks );
updateBlocksInWidgetArea( id, blocks );
},
};
} ),
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-widgets/src/components/widget-areas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function WidgetAreas( { areas } ) {
return areas.map( ( { id }, index ) => (
<WidgetArea
key={ id }
widgetAreaId={ id }
id={ id }
initialOpen={ index === 0 }
/>
) );
Expand Down

0 comments on commit 4f2c6cc

Please sign in to comment.