Skip to content

Commit f6b2e2f

Browse files
committed
fix: correctly wrap blockprops
1 parent bc152a2 commit f6b2e2f

2 files changed

Lines changed: 30 additions & 19 deletions

File tree

src/blocks/avatar/edit.jsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,22 @@ const Edit = ( { attributes, context, setAttributes } ) => {
100100
<AvatarWrapper key={ key } avatar={ currentAvatar } size={ attributes.size } attributes={ attributes } />
101101
);
102102
return (
103-
<div { ...blockProps }>
103+
<>
104104
<AvatarInspectorControls attributes={ attributes } setAttributes={ setAttributes } />
105-
{ authors?.length
106-
? authors.map( ( author, index ) => {
107-
const currentAvatar = {
108-
src: author?.avatar_urls?.[ '96' ],
109-
alt: author?.name,
110-
minSize: 16,
111-
maxSize: 128,
112-
};
113-
return renderAvatar( currentAvatar, author.id || index );
114-
} )
115-
: renderAvatar( avatar, 'single-author' ) }
116-
</div>
105+
<div { ...blockProps }>
106+
{ authors?.length
107+
? authors.map( ( author, index ) => {
108+
const currentAvatar = {
109+
src: author?.avatar_urls?.[ '96' ],
110+
alt: author?.name,
111+
minSize: 16,
112+
maxSize: 128,
113+
};
114+
return renderAvatar( currentAvatar, author.id || index );
115+
} )
116+
: renderAvatar( avatar, 'single-author' ) }
117+
</div>
118+
</>
117119
);
118120
};
119121

src/blocks/correction-box/edit.jsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,28 @@ export default function Edit( { attributes, setAttributes } ) {
7777
}
7878

7979
return 'wp_template' === postType ? (
80-
<div { ...blockProps }>
81-
<EmptyPlaceholder />
80+
<>
8281
<CorrectionSettings />
83-
</div>
82+
<div { ...blockProps }>
83+
<EmptyPlaceholder />
84+
</div>
85+
</>
8486
) : (
85-
<div { ...blockProps }>
87+
<>
8688
<CorrectionSettings />
8789
<BlockControls>
8890
<ToolbarGroup>
8991
<ToolbarButton icon={ update } label={ __( 'Refresh', 'newspack-plugin' ) } onClick={ toggleRefresh } />
9092
</ToolbarGroup>
9193
</BlockControls>
92-
<ServerSideRender block={ meta.name } EmptyResponsePlaceholder={ EmptyPlaceholder } refresh={ isRefreshing } attributes={ attributes } />
93-
</div>
94+
<div { ...blockProps }>
95+
<ServerSideRender
96+
block={ meta.name }
97+
EmptyResponsePlaceholder={ EmptyPlaceholder }
98+
refresh={ isRefreshing }
99+
attributes={ attributes }
100+
/>
101+
</div>
102+
</>
94103
);
95104
}

0 commit comments

Comments
 (0)