* Add multiselect to Apps Forms * Address feedback * Add selected information and change button name * Fix styles * Add missing semicolon and change currentList to currentSelected. * Address UX feedback * Fix test * Address feedback * Fix snapshots * Potential fix for flaky test * Fix iOS back button * Address feedback * Fix tests * Add separator and scroll to bottom on selected items * Use setTimeout for scroll and also scroll on unselected * Fix lint * Fix tsc * Fix tests
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {connect} from 'react-redux';
|
|
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
|
|
|
|
import {setAutocompleteSelector} from '@actions/views/post';
|
|
import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences';
|
|
|
|
import AutocompleteSelector from './autocomplete_selector';
|
|
|
|
import type {Action, ActionResult, GenericAction} from '@mm-redux/types/actions';
|
|
import type {GlobalState} from '@mm-redux/types/store';
|
|
|
|
function mapStateToProps(state: GlobalState) {
|
|
return {
|
|
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
|
theme: getTheme(state),
|
|
};
|
|
}
|
|
|
|
type Actions = {
|
|
setAutocompleteSelector: (dataSource: any, onSelect: any, options: any, getDynamicOptions: any) => Promise<ActionResult>;
|
|
}
|
|
function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
|
|
return {
|
|
actions: bindActionCreators<ActionCreatorsMapObject<Action>, Actions>({
|
|
setAutocompleteSelector,
|
|
}, dispatch),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(AutocompleteSelector);
|