Skip to content

Commit

Permalink
Merge pull request #80 from rishishah-multidots/try/inline-block-comm…
Browse files Browse the repository at this point in the history
…enting

Use enableComplementaryArea
  • Loading branch information
poojabhimani12 authored Oct 21, 2024
2 parents 345c227 + 7a6c085 commit aa2d47b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
8 changes: 0 additions & 8 deletions docs/reference-guides/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1344,14 +1344,6 @@ _Related_
- multiSelect in core/block-editor store.
### openGeneralSidebar
Action that opens an editor sidebar.
_Parameters_
- _name_ `?string`: Sidebar name to be opened.
### openPublishSidebar
Returns an action object used in signalling that the user opened the publish sidebar.
Expand Down
5 changes: 3 additions & 2 deletions packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { addFilter } from '@wordpress/hooks';
import { store as noticesStore } from '@wordpress/notices';
import { store as coreStore } from '@wordpress/core-data';
import { store as blockEditorStore } from '@wordpress/block-editor';
import { store as interfaceStore } from '@wordpress/interface';

/**
* Internal dependencies
Expand Down Expand Up @@ -52,7 +53,7 @@ export default function CollabSidebar() {
const { getEntityRecords, getEntityRecord } = resolveSelect( coreStore );

// eslint-disable-next-line @wordpress/data-no-store-string-literals
const { openGeneralSidebar } = useDispatch( editorStore );
const { enableComplementaryArea } = useDispatch( interfaceStore );
const [ blockCommentID, setBlockCommentID ] = useState( null );
const [ showCommentBoard, setShowCommentBoard ] = useState( false );

Expand Down Expand Up @@ -82,7 +83,7 @@ export default function CollabSidebar() {

const openCollabBoard = () => {
setShowCommentBoard( true );
openGeneralSidebar( 'edit-post/collab-sidebar' );
enableComplementaryArea( 'core', 'edit-post/collab-sidebar' );
};

// Function to save the comment.
Expand Down
16 changes: 0 additions & 16 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ import {
getNotificationArgumentsForSaveFail,
getNotificationArgumentsForTrashFail,
} from './utils/notice-builder';
import { privateApis as editorPrivateApis } from '../private-apis';
import { unlock } from '../lock-unlock';

const { interfaceStore } = unlock( editorPrivateApis );
/**
* Returns an action generator used in signalling that editor has initialized with
* the specified post object and editor settings.
Expand Down Expand Up @@ -195,19 +192,6 @@ export const editPost =
.editEntityRecord( 'postType', type, id, edits, options );
};

/**
* Action that opens an editor sidebar.
*
* @param {?string} name Sidebar name to be opened.
*/
export const openGeneralSidebar =
( name ) =>
( { registry } ) => {
registry
.dispatch( interfaceStore )
.enableComplementaryArea( 'core', name );
};

/**
* Action for saving the current post in the editor.
*
Expand Down

0 comments on commit aa2d47b

Please sign in to comment.