forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from rishishah-multidots/try/inline-block-comm…
…enting Block-Level Comments: All comments are now block-level, with no inline commenting. This is completed. Comment Button Relocation: The button to add a comment has been moved to the ellipsis menu (three vertical dots), and the rich text format option has been removed. This is also done. Custom Comment Type: Comments are now stored as a custom comment type rather than post meta. This is completed as well. Comment API Integration: We have successfully implemented the ability to add and resolve comments using the Comment API
- Loading branch information
Showing
15 changed files
with
765 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/block-editor/src/components/collab/block-comment-menu-item.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { useReducer } from '@wordpress/element'; | ||
import { MenuItem } from '@wordpress/components'; | ||
import { collabComment } from '@wordpress/icons'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import BlockCommentModal from './collab-board'; | ||
|
||
export default function BlockCommentMenuItem( { clientId } ) { | ||
const [ isModalOpen, toggleModal ] = useReducer( | ||
( isActive ) => ! isActive, | ||
false | ||
); | ||
|
||
return ( | ||
<> | ||
<MenuItem | ||
icon={ collabComment } | ||
onClick={ toggleModal } | ||
aria-expanded={ isModalOpen } | ||
aria-haspopup="dialog" | ||
> | ||
{ __( 'Comment' ) } | ||
</MenuItem> | ||
{ isModalOpen && ( | ||
<BlockCommentModal | ||
clientId={ clientId } | ||
onClose={ toggleModal } | ||
/> | ||
) } | ||
</> | ||
); | ||
} |
Oops, something went wrong.