Skip to content

Commit

Permalink
Menu granular subcomponents: Refactor post actions menu (#67645)
Browse files Browse the repository at this point in the history
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people committed Dec 12, 2024
1 parent dd6ec15 commit 5537aaf
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions packages/editor/src/components/post-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,26 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {

return (
<>
<Menu
trigger={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
disabled={ ! actions.length }
accessibleWhenDisabled
className="editor-all-actions-button"
/>
}
placement="bottom-end"
>
<ActionsDropdownMenuGroup
actions={ actions }
items={ itemsWithPermissions }
setActiveModalAction={ setActiveModalAction }
<Menu placement="bottom-end">
<Menu.TriggerButton
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
disabled={ ! actions.length }
accessibleWhenDisabled
className="editor-all-actions-button"
/>
}
/>
<Menu.Popover>
<ActionsDropdownMenuGroup
actions={ actions }
items={ itemsWithPermissions }
setActiveModalAction={ setActiveModalAction }
/>
</Menu.Popover>
</Menu>
{ !! activeModalAction && (
<ActionModal
Expand Down

0 comments on commit 5537aaf

Please sign in to comment.