Skip to content

Commit 472dbaf

Browse files
committed
fix: correctly wrap blockprops
1 parent adacf0f commit 472dbaf

2 files changed

Lines changed: 28 additions & 17 deletions

File tree

src/blocks/avatar/edit.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,20 @@ const Edit = ( { attributes, context, setAttributes } ) => {
149149
<AvatarWrapper key={ key } avatar={ currentAvatar } size={ attributes.size } attributes={ attributes } />
150150
);
151151
return (
152-
<div { ...blockProps }>
152+
<>
153153
<AvatarInspectorControls attributes={ attributes } setAttributes={ setAttributes } />
154-
{ authors?.length
155-
? authors.map( ( author, index ) => {
156-
const currentAvatar = {
157-
src: author.avatarSrc,
158-
alt: author?.name || author?.display_name || '',
159-
};
160-
return renderAvatar( currentAvatar, author.id || index );
161-
} )
162-
: renderAvatar( avatar, 'single-author' ) }
163-
</div>
154+
<div { ...blockProps }>
155+
{ authors?.length
156+
? authors.map( ( author, index ) => {
157+
const currentAvatar = {
158+
src: author.avatarSrc,
159+
alt: author?.name || author?.display_name || '',
160+
};
161+
return renderAvatar( currentAvatar, author.id || index );
162+
} )
163+
: renderAvatar( avatar, 'single-author' ) }
164+
</div>
165+
</>
164166
);
165167
};
166168

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)