From e55109f41c6376e107538daeb89a583f76b1c403 Mon Sep 17 00:00:00 2001 From: rishishah-multidots Date: Fri, 13 Sep 2024 20:26:42 +0530 Subject: [PATCH] resolve eslint errors --- package-lock.json | 2 ++ .../components/collab-sidebar/add-comment.js | 6 +++++- .../collab-sidebar/commentButton.js | 1 - .../src/components/collab-sidebar/index.js | 20 +++++++++---------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdfaf033b93653..77848768abbcc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53627,6 +53627,7 @@ "@babel/runtime": "^7.16.0", "@wordpress/a11y": "file:../a11y", "@wordpress/api-fetch": "file:../api-fetch", + "@wordpress/autop": "^4.7.0", "@wordpress/blob": "file:../blob", "@wordpress/block-editor": "file:../block-editor", "@wordpress/blocks": "file:../blocks", @@ -68262,6 +68263,7 @@ "@babel/runtime": "^7.16.0", "@wordpress/a11y": "file:../a11y", "@wordpress/api-fetch": "file:../api-fetch", + "@wordpress/autop": "^4.7.0", "@wordpress/blob": "file:../blob", "@wordpress/block-editor": "file:../block-editor", "@wordpress/blocks": "file:../blocks", diff --git a/packages/editor/src/components/collab-sidebar/add-comment.js b/packages/editor/src/components/collab-sidebar/add-comment.js index e72429f435d3e3..6fea9c9a4f05cb 100644 --- a/packages/editor/src/components/collab-sidebar/add-comment.js +++ b/packages/editor/src/components/collab-sidebar/add-comment.js @@ -27,7 +27,11 @@ import { sanitizeCommentString } from './utils'; * @param {Function} props.setShowCommentBoard - The function to delete the comment. * @return {JSX.Element} The rendered comment input UI. */ -export function AddComment( { onSubmit, showCommentBoard, setShowCommentBoard } ) { +export function AddComment( { + onSubmit, + showCommentBoard, + setShowCommentBoard, +} ) { // State to manage the comment thread. const [ inputComment, setInputComment ] = useState( '' ); diff --git a/packages/editor/src/components/collab-sidebar/commentButton.js b/packages/editor/src/components/collab-sidebar/commentButton.js index 67362afc5ffbca..198ce909eee04a 100644 --- a/packages/editor/src/components/collab-sidebar/commentButton.js +++ b/packages/editor/src/components/collab-sidebar/commentButton.js @@ -7,7 +7,6 @@ import { comment as commentIcon } from '@wordpress/icons'; import { __unstableCommentIconFill as CommentIconFill } from '@wordpress/block-editor'; const AddCommentButton = ( { onClick } ) => { - return ( [] ); @@ -67,14 +67,16 @@ export default function CollabSidebar() { const clientId = useSelect( ( select ) => { const { getSelectedBlockClientId } = select( blockEditorStore ); - setBlockCommentID( select( blockEditorStore ).getBlock( getSelectedBlockClientId() )?.attributes.blockCommentId ); + setBlockCommentID( + select( blockEditorStore ).getBlock( getSelectedBlockClientId() ) + ?.attributes.blockCommentId + ); return getSelectedBlockClientId(); }, [] ); // Get the dispatch functions to save the comment and update the block attributes. const { updateBlockAttributes } = useDispatch( blockEditorStore ); - const openCollabBoard = () => { setShowCommentBoard( true ); openGeneralSidebar( 'edit-post/collab-sidebar' ); @@ -273,16 +275,12 @@ export default function CollabSidebar() { return ( <> { ! blockCommentID && ( - - )} + + ) } { blockCommentID > 0 && ( - - )} + + ) }