diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-02-09 17:25:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 17:25:57 +0100 |
commit | 8987ea4d6b236657b8ea97d619902668768ae8ff (patch) | |
tree | d1be73fd2f80572f4b54857c51bae95327314e40 /app/javascript/flavours/glitch/containers | |
parent | 2fd1db7c9d0fe8c1cca159b9b0818c72e7c318aa (diff) | |
parent | 0bb3d445ab0167ac33bd804333c7f9741c7526ae (diff) |
Merge pull request #1682 from ClearlyClaire/glitch-soc/fixes/dropdowns-modals
Refactor and fix dropdown/action dialog
Diffstat (limited to 'app/javascript/flavours/glitch/containers')
-rw-r--r-- | app/javascript/flavours/glitch/containers/dropdown_menu_container.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js index 1c0385b74..0c4a2b50f 100644 --- a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js +++ b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js @@ -14,15 +14,11 @@ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({ onOpen(id, onItemClick, dropdownPlacement, keyboard) { dispatch(isUserTouching() ? openModal('ACTIONS', { status, - actions: items.map( - (item, i) => item ? { - ...item, - name: `${item.text}-${i}`, - onClick: item.action ? ((e) => { return onItemClick(i, e) }) : null, - } : null - ), + actions: items, + onClick: onItemClick, }) : openDropdownMenu(id, dropdownPlacement, keyboard, scrollKey)); }, + onClose(id) { dispatch(closeModal('ACTIONS')); dispatch(closeDropdownMenu(id)); |