Skip to content

Commit

Permalink
Refactor dataviews item actions menu (#67636)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Dec 12, 2024
1 parent 2261b77 commit a2993f7
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions packages/dataviews/src/components/dataviews-item-actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,25 +229,27 @@ function CompactItemActions< Item >( {
);
return (
<>
<Menu
trigger={
<Button
size={ isSmall ? 'small' : 'compact' }
icon={ moreVertical }
label={ __( 'Actions' ) }
accessibleWhenDisabled
disabled={ ! actions.length }
className="dataviews-all-actions-button"
/>
}
placement="bottom-end"
>
<ActionsMenuGroup
actions={ actions }
item={ item }
registry={ registry }
setActiveModalAction={ setActiveModalAction }
<Menu placement="bottom-end">
<Menu.TriggerButton
render={
<Button
size={ isSmall ? 'small' : 'compact' }
icon={ moreVertical }
label={ __( 'Actions' ) }
accessibleWhenDisabled
disabled={ ! actions.length }
className="dataviews-all-actions-button"
/>
}
/>
<Menu.Popover>
<ActionsMenuGroup
actions={ actions }
item={ item }
registry={ registry }
setActiveModalAction={ setActiveModalAction }
/>
</Menu.Popover>
</Menu>
{ !! activeModalAction && (
<ActionModal
Expand Down

0 comments on commit a2993f7

Please sign in to comment.