Skip to content

Commit

Permalink
Refactor post actions menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Nov 29, 2024
1 parent 9c0a740 commit 72c8324
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions packages/editor/src/components/post-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,33 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
return (
<Menu
open={ isActionsMenuOpen }
trigger={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
disabled={ ! actions.length }
accessibleWhenDisabled
className="editor-all-actions-button"
onClick={ () =>
setIsActionsMenuOpen( ! isActionsMenuOpen )
}
/>
}
onOpenChange={ setIsActionsMenuOpen }
placement="bottom-end"
>
<ActionsDropdownMenuGroup
actions={ actions }
item={ itemWithPermissions }
onClose={ () => {
setIsActionsMenuOpen( false );
} }
<Menu.TriggerButton
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
disabled={ ! actions.length }
accessibleWhenDisabled
className="editor-all-actions-button"
onClick={ () =>
setIsActionsMenuOpen( ! isActionsMenuOpen )
}
/>
}
/>
<Menu.Popover>
<ActionsDropdownMenuGroup
actions={ actions }
item={ itemWithPermissions }
onClose={ () => {
setIsActionsMenuOpen( false );
} }
/>
</Menu.Popover>
</Menu>
);
}
Expand Down

0 comments on commit 72c8324

Please sign in to comment.