Refactor dropdown and action modal code slightly

Simplify it a bit and make it closer to upstream
This commit is contained in:
Claire
2022-02-09 12:23:57 +01:00
parent 2fd1db7c9d
commit f87ce13afc
4 changed files with 25 additions and 45 deletions

View File

@ -18,11 +18,12 @@ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
(item, i) => item ? {
...item,
name: `${item.text}-${i}`,
onClick: item.action ? ((e) => { return onItemClick(i, e) }) : null,
} : null
),
onClick: onItemClick,
}) : openDropdownMenu(id, dropdownPlacement, keyboard, scrollKey));
},
onClose(id) {
dispatch(closeModal('ACTIONS'));
dispatch(closeDropdownMenu(id));