Skip to content

Commit

Permalink
Remove homepage action from edit-site
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Nov 18, 2024
1 parent fb2ea4c commit 1a1f682
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 247 deletions.
3 changes: 0 additions & 3 deletions packages/edit-site/src/components/dataviews-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
*/
import { PATTERN_TYPES } from '../../utils/constants';
import { unlock } from '../../lock-unlock';
import { useSetAsHomepageAction } from './set-as-homepage';

const { useHistory } = unlock( routerPrivateApis );

Expand Down Expand Up @@ -42,5 +41,3 @@ export const useEditPostAction = () => {
[ history ]
);
};

export { useSetAsHomepageAction };
229 changes: 0 additions & 229 deletions packages/edit-site/src/components/dataviews-actions/set-as-homepage.js

This file was deleted.

10 changes: 3 additions & 7 deletions packages/edit-site/src/components/post-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ import {

import AddNewPostModal from '../add-new-post';
import { unlock } from '../../lock-unlock';
import {
useEditPostAction,
useSetAsHomepageAction,
} from '../dataviews-actions';
import { useEditPostAction } from '../dataviews-actions';
import { usePrevious } from '@wordpress/compose';

const { usePostActions, usePostFields } = unlock( editorPrivateApis );
Expand Down Expand Up @@ -348,11 +345,10 @@ export default function PostList( { postType } ) {
context: 'list',
} );
const editAction = useEditPostAction();
const setAsHomepageAction = useSetAsHomepageAction();

const actions = useMemo(
() => [ editAction, setAsHomepageAction, ...postTypeActions ],
[ postTypeActions, editAction, setAsHomepageAction ]
() => [ editAction, ...postTypeActions ],
[ postTypeActions, editAction ]
);

const [ showAddPostModal, setShowAddPostModal ] = useState( false );
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-site/src/utils/get-item-title.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/edit-site/src/utils/get-item-title.d.ts.map

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import { store as noticesStore } from '@wordpress/notices';
/**
* Internal dependencies
*/
import { getItemTitle } from '../../../../../packages/edit-site/src/utils/get-item-title';

// This action is duplicated and copied from packages/edit-site/src/components/dataviews-actions/set-as-homepage.js
import { getItemTitle } from '../../utils/get-item-title';

const SetAsHomepageModal = ( { items, closeModal, onActionPerformed } ) => {
const [ item ] = items;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*/
import { decodeEntities } from '@wordpress/html-entities';

// TODO: This function is duplicated in packages/editor/src/dataviews/actions/utils.ts,
// so they should be consolidated.
// This function is copied from packages/editor/src/dataviews/actions/utils.ts.

export function getItemTitle( item ) {
if ( typeof item.title === 'string' ) {
Expand Down

0 comments on commit 1a1f682

Please sign in to comment.