Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed May 10, 2024
1 parent b4b1760 commit b003ae4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
29 changes: 23 additions & 6 deletions packages/dataviews/src/item-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ function DropdownMenuItemTrigger( { action, onClick } ) {
);
}

export function ActionModal( { action, item, closeModal, onActionStart, onActionPerformed } ) {
export function ActionModal( {
action,
items,
closeModal,
onActionStart,
onActionPerformed,
} ) {
return (
<Modal
title={ action.modalHeader || action.label }
Expand All @@ -57,13 +63,24 @@ export function ActionModal( { action, item, closeModal, onActionStart, onAction
action.id
) }` }
>
<action.RenderModal items={ [ item ] } closeModal={ closeModal } onActionStart={ onActionStart } onActionPerformed={ onActionPerformed }
/>
<action.RenderModal
items={ items }
closeModal={ closeModal }
onActionStart={ onActionStart }
onActionPerformed={ onActionPerformed }
/>
</Modal>
);
}

function ActionWithModal( { action, item, ActionTrigger, onActionStart, onActionPerformed, isBusy } ) {
export function ActionWithModal( {
action,
items,
ActionTrigger,
onActionStart,
onActionPerformed,
isBusy,
} ) {
const [ isModalOpen, setIsModalOpen ] = useState( false );
const actionTriggerProps = {
action,
Expand All @@ -79,10 +96,10 @@ function ActionWithModal( { action, item, ActionTrigger, onActionStart, onAction
{ isModalOpen && (
<ActionModal
action={ action }
item={ item }
items={ items }
closeModal={ () => setIsModalOpen( false ) }
onActionStart={ onActionStart }
onActionPerformed={ onActionPerformed}
onActionPerformed={ onActionPerformed }
/>
) }
</>
Expand Down
4 changes: 3 additions & 1 deletion packages/dataviews/src/view-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ function ListItem( {
{ isModalOpen && (
<ActionModal
action={ primaryAction }
item={ item }
items={ [ item ] }
closeModal={ () =>
setIsModalOpen( false )
}
onActionStart={ () => {} }
onActionPerformed={ () => {} }
/>
) }
</CompositeItem>
Expand Down

0 comments on commit b003ae4

Please sign in to comment.