Skip to content

Commit

Permalink
Menu granular subcomponents: Refactor dataviews list layout actions m…
Browse files Browse the repository at this point in the history
…enu (#67639)

Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: oandregal <[email protected]>
  • Loading branch information
4 people committed Dec 13, 2024
1 parent 5ec36f3 commit 685bdc4
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions packages/dataviews/src/dataviews-layouts/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,32 +215,36 @@ function ListItem< Item >( {
) }
{ ! hasOnlyOnePrimaryAction && (
<div role="gridcell">
<Menu
trigger={
<Composite.Item
id={ generateDropdownTriggerCompositeId(
idPrefix
) }
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
accessibleWhenDisabled
disabled={ ! actions.length }
onKeyDown={ onDropdownTriggerKeyDown }
/>
}
/>
}
placement="bottom-end"
>
<ActionsMenuGroup
actions={ eligibleActions }
item={ item }
registry={ registry }
setActiveModalAction={ setActiveModalAction }
<Menu placement="bottom-end">
<Menu.TriggerButton
render={
<Composite.Item
id={ generateDropdownTriggerCompositeId(
idPrefix
) }
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Actions' ) }
accessibleWhenDisabled
disabled={ ! actions.length }
onKeyDown={
onDropdownTriggerKeyDown
}
/>
}
/>
}
/>
<Menu.Popover>
<ActionsMenuGroup
actions={ eligibleActions }
item={ item }
registry={ registry }
setActiveModalAction={ setActiveModalAction }
/>
</Menu.Popover>
</Menu>
{ !! activeModalAction && (
<ActionModal
Expand Down

0 comments on commit 685bdc4

Please sign in to comment.