Skip to content

Commit

Permalink
Remove quick edit from list layout
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 19, 2024
1 parent 496573b commit 3cae411
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/edit-site/src/components/layout/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default function useLayoutAreas() {
// Page list
if ( postType === 'page' ) {
const isListLayout = layout === 'list' || ! layout;
const showQuickEdit = quickEdit && ! isListLayout;
return {
key: 'pages',
areas: {
Expand All @@ -94,20 +95,20 @@ export default function useLayoutAreas() {
/>
),
content: <PostList postType={ postType } />,
preview: ! quickEdit &&
preview: ! showQuickEdit &&
( isListLayout || hasEditCanvasMode ) && <Editor />,
mobile: hasEditCanvasMode ? (
<Editor />
) : (
<PostList postType={ postType } />
),
edit: quickEdit && (
edit: showQuickEdit && (
<PostEdit postType={ postType } postId={ postId } />
),
},
widths: {
content: ! quickEdit && isListLayout ? 380 : undefined,
edit: quickEdit ? 380 : undefined,
content: isListLayout ? 380 : undefined,
edit: showQuickEdit ? 380 : undefined,
},
};
}
Expand Down
7 changes: 6 additions & 1 deletion packages/edit-site/src/components/post-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import {
useDefaultViews,
defaultLayouts,
} from '../sidebar-dataviews/default-views';
import { OPERATOR_IS_ANY, OPERATOR_IS_NONE } from '../../utils/constants';
import {
OPERATOR_IS_ANY,
OPERATOR_IS_NONE,
LAYOUT_LIST,
} from '../../utils/constants';

import AddNewPostModal from '../add-new-post';
import { unlock } from '../../lock-unlock';
Expand Down Expand Up @@ -295,6 +299,7 @@ export default function PostList( { postType } ) {
getItemId={ getItemId }
defaultLayouts={ defaultLayouts }
header={
view.type !== LAYOUT_LIST &&
postType === 'page' && (
<Button
size="compact"
Expand Down

0 comments on commit 3cae411

Please sign in to comment.