Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed May 2, 2024
1 parent 7c99c86 commit e8909af
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
19 changes: 8 additions & 11 deletions packages/edit-post/src/components/sidebar/post-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const {
const PANEL_NAME = 'post-status';

export default function PostStatus() {
const { isOpened, isRemoved, showExcerptAndLastEditedPanels } = useSelect(
const { isOpened, isRemoved, showPostContentPanels } = 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.
Expand All @@ -57,7 +57,7 @@ export default function PostStatus() {
isOpened: isEditorPanelOpened( PANEL_NAME ),
// Post excerpt panel is rendered in different place depending on the post type.
// So we cannot make this check inside the PostExcerpt component based on the current edited entity.
showExcerptAndLastEditedPanels: ! [
showPostContentPanels: ! [
'wp_template',
'wp_template_part',
'wp_block',
Expand All @@ -82,7 +82,7 @@ export default function PostStatus() {
<PluginPostStatusInfo.Slot>
{ ( fills ) => (
<>
{ showExcerptAndLastEditedPanels && (
{ showPostContentPanels && (
<VStack
spacing={ 3 }
// TODO: this needs to be consolidated with the panel in site editor, when we unify them.
Expand All @@ -91,14 +91,11 @@ export default function PostStatus() {
<PostFeaturedImagePanel
withPanelBody={ false }
/>

<>
<PrivatePostExcerptPanel />
<VStack spacing={ 1 }>
<PostContentInformation />
<PostLastEditedPanel />
</VStack>
</>
<PrivatePostExcerptPanel />
<VStack spacing={ 1 }>
<PostContentInformation />
<PostLastEditedPanel />
</VStack>
</VStack>
) }
<VStack
Expand Down
8 changes: 4 additions & 4 deletions packages/editor/src/components/post-card-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { unlock } from '../../lock-unlock';
import TemplateAreas from '../template-areas';

export default function PostCardPanel( { className, actions } ) {
const { title, showExcerptAndLastEditedPanels, icon, postType } = useSelect(
const { title, showPostContentPanels, icon, postType } = useSelect(
( select ) => {
const {
getEditedPostAttribute,
Expand All @@ -59,7 +59,7 @@ export default function PostCardPanel( { className, actions } ) {
} ),
// Post excerpt panel and Last Edited info are rendered in different place depending on the post type.
// So we cannot make this check inside the PostExcerpt or PostLastEditedPanel component based on the current edited entity.
showExcerptAndLastEditedPanels: [
showPostContentPanels: [
TEMPLATE_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
PATTERN_POST_TYPE,
Expand All @@ -72,7 +72,7 @@ export default function PostCardPanel( { className, actions } ) {
<PanelBody>
<div
className={ classnames( 'editor-post-card-panel', className, {
'has-description': showExcerptAndLastEditedPanels,
'has-description': showPostContentPanels,
} ) }
>
<HStack
Expand All @@ -96,7 +96,7 @@ export default function PostCardPanel( { className, actions } ) {
{ actions }
</HStack>
<VStack className="editor-post-card-panel__content">
{ showExcerptAndLastEditedPanels && (
{ showPostContentPanels && (
<VStack
className="editor-post-card-panel__description"
spacing={ 2 }
Expand Down
11 changes: 5 additions & 6 deletions packages/editor/src/components/post-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,7 @@ export default function PostStatus() {

return (
<PostPanelRow label={ __( 'Status' ) } ref={ setPopoverAnchor }>
{ ! canEdit && (
<div className="editor-post-status">
<PostStatusLabel />
</div>
) }
{ canEdit && (
{ canEdit ? (
<Dropdown
className="editor-post-status"
contentClassName="editor-change-status__content"
Expand Down Expand Up @@ -313,6 +308,10 @@ export default function PostStatus() {
</>
) }
/>
) : (
<div className="editor-post-status">
<PostStatusLabel />
</div>
) }
</PostPanelRow>
);
Expand Down

0 comments on commit e8909af

Please sign in to comment.