Skip to content

Commit

Permalink
Add experimental condition
Browse files Browse the repository at this point in the history
  • Loading branch information
MD-sunilprajapati committed Jun 13, 2024
1 parent 6c0862d commit 77ee009
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/format-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@wordpress/block-editor": "file:../block-editor",
"@wordpress/components": "file:../components",
"@wordpress/compose": "file:../compose",
"@wordpress/core-data": "^7.0.0",
"@wordpress/core-data": "file:../core-data",
"@wordpress/data": "file:../data",
"@wordpress/element": "file:../element",
"@wordpress/html-entities": "file:../html-entities",
Expand Down
19 changes: 12 additions & 7 deletions packages/format-library/src/collab-comment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import CollabBoard from './collab-board';
const name = 'core/collab-comment';
const title = __( 'Add Comment' );

const isBlockCommentExperimentEnabled =
window?.__experimentalEnableBlockComment;

function Edit( { isActive, value, onChange, onFocus, contentRef } ) {
function onClick() {
onChange(
Expand Down Expand Up @@ -55,14 +58,16 @@ function Edit( { isActive, value, onChange, onFocus, contentRef } ) {
}, [ contentRef ] );
return (
<>
<RichTextToolbarButton
icon={ commentIcon }
title={ title }
onClick={ onClick }
isActive={ isActive }
/>
{ isBlockCommentExperimentEnabled && (
<RichTextToolbarButton
icon={ commentIcon }
title={ title }
onClick={ onClick }
isActive={ isActive }
/>
) }

{ isDiscussionBoardVisible && (
{ isBlockCommentExperimentEnabled && isDiscussionBoardVisible && (
<CollabBoard
contentRef={ contentRef }
onClose={ toggleDiscussionBoardVisibility }
Expand Down

0 comments on commit 77ee009

Please sign in to comment.