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

Remove trash button in post/page inspector #61792

Merged
merged 3 commits into from
May 21, 2024
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
13 changes: 0 additions & 13 deletions packages/editor/src/components/post-trash/panel.js

This file was deleted.

17 changes: 1 addition & 16 deletions packages/editor/src/components/sidebar/post-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@ import PostStatusPanel from '../post-status';
import PostStickyPanel from '../post-sticky';
import PostSyncStatus from '../post-sync-status';
import PostTemplatePanel from '../post-template/panel';
import PostTrashPanel from '../post-trash/panel';
import PostURLPanel from '../post-url/panel';
import BlogTitle from '../blog-title';
import PostsPerPage from '../posts-per-page';
import SiteDiscussion from '../site-discussion';
import { store as editorStore } from '../../store';
import {
NAVIGATION_POST_TYPE,
PATTERN_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
TEMPLATE_POST_TYPE,
} from '../../store/constants';
import TemplateAreas from '../template-areas';

/**
Expand All @@ -43,7 +36,7 @@ import TemplateAreas from '../template-areas';
const PANEL_NAME = 'post-status';

export default function PostSummary( { onActionPerformed } ) {
const { isRemovedPostStatusPanel, postType } = useSelect( ( select ) => {
const { isRemovedPostStatusPanel } = useSelect( ( select ) => {
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
const { isEditorPanelRemoved, getCurrentPostType } =
Expand All @@ -53,10 +46,6 @@ export default function PostSummary( { onActionPerformed } ) {
postType: getCurrentPostType(),
};
}, [] );
const isPattern = postType === PATTERN_POST_TYPE;
const isTemplate = postType === TEMPLATE_POST_TYPE;
const isTemplatePart = postType === TEMPLATE_PART_POST_TYPE;
const isNavigation = postType === NAVIGATION_POST_TYPE;

return (
<PostPanelSection className="editor-post-summary">
Expand Down Expand Up @@ -95,10 +84,6 @@ export default function PostSummary( { onActionPerformed } ) {
<PostFormatPanel />
<TemplateAreas />
{ fills }
{ ! isPattern &&
! isTemplate &&
! isTemplatePart &&
! isNavigation && <PostTrashPanel /> }
</VStack>
) }
</VStack>
Expand Down
Loading