Merge pull request #442 from ThibG/glitch-soc/fixes/actions-modal-mobile

Fix actions modal on mobile (fixes #441)
This commit is contained in:
ThibG 2018-04-23 23:42:29 +02:00 committed by GitHub
commit 65b8880ec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -14,8 +14,13 @@ const mapDispatchToProps = (dispatch, { status, items }) => ({
onOpen(id, onItemClick, dropdownPlacement) {
dispatch(isUserTouching() ? openModal('ACTIONS', {
status,
actions: items,
onClick: onItemClick,
actions: items.map(
(item, i) => item ? {
...item,
name: `${item.text}-${i}`,
onClick: (e) => { return onItemClick(i, e) },
} : null
),
}) : openDropdownMenu(id, dropdownPlacement));
},
onClose(id) {

View File

@ -22,7 +22,6 @@ export default class ActionsModal extends ImmutablePureComponent {
meta: PropTypes.node,
name: PropTypes.string,
on: PropTypes.bool,
onClick: PropTypes.func,
onPassiveClick: PropTypes.func,
text: PropTypes.node,
})),