0
0
Fork 0

Convert dropdown_menu state to Typescript (#25585)

This commit is contained in:
Renaud Chaput 2023-09-22 18:18:46 +02:00 committed by GitHub
parent b93ffb74bb
commit 4b7bc1f07c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 69 additions and 41 deletions

View file

@ -7,9 +7,12 @@ import { openModal, closeModal } from '../actions/modal';
import DropdownMenu from '../components/dropdown_menu';
import { isUserTouching } from '../is_mobile';
/**
* @param {import('mastodon/store').RootState} state
*/
const mapStateToProps = state => ({
openDropdownId: state.getIn(['dropdown_menu', 'openId']),
openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),
openDropdownId: state.dropdownMenu.openId,
openedViaKeyboard: state.dropdownMenu.keyboard,
});
const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
@ -25,7 +28,7 @@ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
actions: items,
onClick: onItemClick,
},
}) : openDropdownMenu(id, keyboard, scrollKey));
}) : openDropdownMenu({ id, keyboard, scrollKey }));
},
onClose(id) {
@ -33,7 +36,7 @@ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
modalType: 'ACTIONS',
ignoreFocus: false,
}));
dispatch(closeDropdownMenu(id));
dispatch(closeDropdownMenu({ id }));
},
});