Skip to content

Commit

Permalink
Site Editor: Add the Discussion panel (#57150)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and artemiomorales committed Jan 4, 2024
1 parent 3177b9f commit dfda4b6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { store as interfaceStore } from '@wordpress/interface';
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
import {
store as editorStore,
PostDiscussionPanel,
PostExcerptPanel,
PostFeaturedImagePanel,
PostLastRevisionPanel,
Expand All @@ -24,7 +25,6 @@ import {
*/
import SettingsHeader from '../settings-header';
import PostStatus from '../post-status';
import DiscussionPanel from '../discussion-panel';
import PageAttributes from '../page-attributes';
import MetaBoxes from '../../meta-boxes';
import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
Expand Down Expand Up @@ -85,7 +85,7 @@ const SidebarContent = ( {
<PostTaxonomiesPanel />
<PostFeaturedImagePanel />
<PostExcerptPanel />
<DiscussionPanel />
<PostDiscussionPanel />
<PageAttributes />
<MetaBoxes location="side" />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { decodeEntities } from '@wordpress/html-entities';
import {
PostDiscussionPanel,
PostExcerptPanel,
PostFeaturedImagePanel,
PostLastRevisionPanel,
Expand Down Expand Up @@ -104,6 +105,7 @@ export default function PagePanels() {
<PostTaxonomiesPanel />
<PostFeaturedImagePanel />
<PostExcerptPanel />
<PostDiscussionPanel />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { useSelect } from '@wordpress/data';
import { PanelBody } from '@wordpress/components';
import {
PostDiscussionPanel,
PostExcerptPanel,
PostFeaturedImagePanel,
PostLastRevisionPanel,
Expand Down Expand Up @@ -68,6 +69,7 @@ export default function TemplatePanel() {
<PostTaxonomiesPanel />
<PostFeaturedImagePanel />
<PostExcerptPanel />
<PostDiscussionPanel />
</>
);
}
1 change: 1 addition & 0 deletions packages/editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export { default as PostAuthor } from './post-author';
export { default as PostAuthorCheck } from './post-author/check';
export { default as PostAuthorPanel } from './post-author/panel';
export { default as PostComments } from './post-comments';
export { default as PostDiscussionPanel } from './post-discussion/panel';
export { default as PostExcerpt } from './post-excerpt';
export { default as PostExcerptCheck } from './post-excerpt/check';
export { default as PostExcerptPanel } from './post-excerpt/panel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
*/
import { __ } from '@wordpress/i18n';
import { PanelBody, PanelRow } from '@wordpress/components';
import {
PostComments,
PostPingbacks,
PostTypeSupportCheck,
store as editorStore,
} from '@wordpress/editor';
import { useDispatch, useSelect } from '@wordpress/data';

/**
* Module Constants
* Internal dependencies
*/
import { store as editorStore } from '../../store';
import PostTypeSupportCheck from '../post-type-support-check';
import PostComments from '../post-comments';
import PostPingbacks from '../post-pingbacks';

const PANEL_NAME = 'discussion-panel';

function DiscussionPanel() {
function PostDiscussionPanel() {
const { isEnabled, isOpened } = useSelect( ( select ) => {
const { isEditorPanelEnabled, isEditorPanelOpened } =
select( editorStore );
Expand Down Expand Up @@ -55,4 +54,4 @@ function DiscussionPanel() {
);
}

export default DiscussionPanel;
export default PostDiscussionPanel;

0 comments on commit dfda4b6

Please sign in to comment.