mattermost-mobile/app/actions/views/options_modal.js
enahum bfd70f742c Modal with options (#179)
* modal options and channel long press

* PureComponent optimization (#183)

* Bug fix when leaving the current channel

* Rebased with new navigation

* Add disabled drawer to unit test

* re-organize modal up in the stack and controlled by redux

* renaming modalOptions to optionsModal
2017-01-30 08:41:14 -05:00

30 lines
744 B
JavaScript

// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {ViewTypes} from 'app/constants';
export function openModal(title, options) {
return async (dispatch, getState) => {
dispatch({
type: ViewTypes.OPTIONS_MODAL_CHANGED,
data: {
title,
options,
visible: true
}
}, getState);
};
}
export function closeModal() {
return async (dispatch, getState) => {
dispatch({
type: ViewTypes.OPTIONS_MODAL_CHANGED,
data: {
title: '',
options: [],
visible: false
}
}, getState);
};
}