Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Editor: Add the Discussion panel #57150

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading