mattermost-mobile/app/utils/bottom_sheet/bottom_sheet.android.js
Elias Nahum b8af8a3860
Lazy android native modules (#2973)
* Lazy loading Android modules

* Remove react-native-bottom-sheet

* Remove comments

* npm audit fix

* Update rnn-v2 modals

* audit fix

* Fix tests
2019-07-17 11:06:21 -04:00

20 lines
646 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {store} from 'app/mattermost';
import {showModalOverCurrentContext} from 'app/actions/navigation';
export default {
showBottomSheetWithOptions: (options, callback) => {
function itemAction(index) {
callback(index);
}
const items = options.options.splice(0, options.cancelButtonIndex).map((o, index) => ({
action: () => itemAction(index),
text: o,
}));
store.dispatch(showModalOverCurrentContext('OptionsModal', {title: '', items}));
},
};