From 28b4d69f16e571f42e73f007244d68054e344cdd Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Tue, 31 Aug 2021 15:41:59 -0300 Subject: [PATCH 1/2] use key for lists to avoid console error/warning --- client/components/block-alignment-control/icon.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/components/block-alignment-control/icon.js b/client/components/block-alignment-control/icon.js index 1923539a..6ebd9745 100644 --- a/client/components/block-alignment-control/icon.js +++ b/client/components/block-alignment-control/icon.js @@ -6,10 +6,15 @@ import classnames from 'classnames'; import { map } from 'lodash'; const BlockAlignmentControlIcon = ( { rows, columns, value } ) => { + let spanKeyNum = 0; + let divKeyNum = 0; return (
{ map( rows, ( row ) => ( -
+
{ map( columns, ( column ) => { const isActive = row.value === value.row && @@ -22,7 +27,9 @@ const BlockAlignmentControlIcon = ( { rows, columns, value } ) => { } ); - return ; + return ( + + ); } ) }
) ) } From 374ac70377c7e87981e11181820ecb84100279c0 Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Tue, 31 Aug 2021 15:43:01 -0300 Subject: [PATCH 2/2] replace editorFeatures for single value fullscreenMode. A check is made to see if the new interface package is available and use isFeatureActive if it is --- client/blocks/feedback/edit.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/client/blocks/feedback/edit.js b/client/blocks/feedback/edit.js index b89f941a..68384ad0 100644 --- a/client/blocks/feedback/edit.js +++ b/client/blocks/feedback/edit.js @@ -47,7 +47,7 @@ const EditFeedbackBlock = ( props ) => { const { attributes, activeSidebar, - editorFeatures, + isFullscreen, fallbackStyles, isSelected, setAttributes, @@ -182,7 +182,7 @@ const EditFeedbackBlock = ( props ) => { } ); }, [ activeSidebar, - editorFeatures.fullscreenMode, + isFullscreen, isSelected, setPosition, attributes.x, @@ -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(); @@ -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, }; } ),