* 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
30 lines
744 B
JavaScript
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);
|
|
};
|
|
}
|