Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new interface package compatibility #168

Merged
merged 2 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions client/blocks/feedback/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const EditFeedbackBlock = ( props ) => {
const {
attributes,
activeSidebar,
editorFeatures,
isFullscreen,
fallbackStyles,
isSelected,
setAttributes,
Expand Down Expand Up @@ -182,7 +182,7 @@ const EditFeedbackBlock = ( props ) => {
} );
}, [
activeSidebar,
editorFeatures.fullscreenMode,
isFullscreen,
isSelected,
setPosition,
attributes.x,
Expand Down Expand Up @@ -227,12 +227,7 @@ const EditFeedbackBlock = ( props ) => {
right: window.innerWidth - ( contentBox.left + contentBox.width ),
top: contentBox.top,
} );
}, [
activeSidebar,
editorFeatures.fullscreenMode,
isSelected,
triggerButton.current,
] );
}, [ activeSidebar, isFullscreen, isSelected, triggerButton.current ] );

const toggleBlock = () => {
dispatch( 'core/block-editor' ).clearSelectedBlock();
Expand Down Expand Up @@ -485,13 +480,16 @@ export default compose( [
if ( ! url ) {
url = select( 'core' ).getSite() && select( 'core' ).getSite().url;
}
const editPost = select( 'core/edit-post' );
const isFullscreen =
'isFeatureActive' in editPost
? editPost.isFeatureActive( 'fullscreenMode' )
: editPost.getPreference( 'fullscreenMode' );
return {
activeSidebar: select(
'core/edit-post'
).getActiveGeneralSidebarName(),
editorFeatures: select( 'core/edit-post' ).getPreference(
'features'
),
isFullscreen,
sourceLink: url,
};
} ),
Expand Down
11 changes: 9 additions & 2 deletions client/components/block-alignment-control/icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ import classnames from 'classnames';
import { map } from 'lodash';

const BlockAlignmentControlIcon = ( { rows, columns, value } ) => {
let spanKeyNum = 0;
let divKeyNum = 0;
return (
<div className="crowdsignal-forms__block-alignment-control-icon">
{ map( rows, ( row ) => (
<div className="crowdsignal-forms__block-alignment-control-icon-row">
<div
key={ divKeyNum++ }
className="crowdsignal-forms__block-alignment-control-icon-row"
>
{ map( columns, ( column ) => {
const isActive =
row.value === value.row &&
Expand All @@ -22,7 +27,9 @@ const BlockAlignmentControlIcon = ( { rows, columns, value } ) => {
}
);

return <span className={ classes } />;
return (
<span key={ spanKeyNum++ } className={ classes } />
);
} ) }
</div>
) ) }
Expand Down