mattermost-mobile/app/scenes/edit_post/index.js
enahum 58f1b3a552 PLT-5660 Ability to edit a post (#399)
* Ability to edit a post

* address feedback
2017-03-26 22:31:16 -03:00

37 lines
1 KiB
JavaScript

// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import navigationSceneConnect from '../navigationSceneConnect';
import {closeModal} from 'app/actions/navigation';
import {getTheme} from 'app/selectors/preferences';
import {editPost} from 'mattermost-redux/actions/posts';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import EditPost from './edit_post';
function mapStateToProps(state, ownProps) {
const {editPost: editPostRequest} = state.requests.posts;
return {
...ownProps,
currentTeamId: getCurrentTeamId(state),
editPostRequest,
post: ownProps.post,
theme: getTheme(state)
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
closeModal,
editPost
}, dispatch)
};
}
export default navigationSceneConnect(mapStateToProps, mapDispatchToProps)(EditPost);