* Fixed copyright date * Removed unnecessary components folder from channel scene * Added initial version of post textbox * Moved getTheme into a proper selector * Moved ChannelHeader into its own component * Flipped post list so that the most recent posts appear at the bottom * Moved post textbox value into redux view store * Switched new components from PureRenderMixin to React.PureComponent
29 lines
820 B
JavaScript
29 lines
820 B
JavaScript
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {createPost} from 'service/actions/posts';
|
|
import {getTheme} from 'service/selectors/entities/preferences';
|
|
import {getCurrentUserId} from 'service/selectors/entities/users';
|
|
|
|
import PostTextbox from './post_textbox';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
return {
|
|
...ownProps,
|
|
currentUserId: getCurrentUserId(state),
|
|
theme: getTheme(state)
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
createPost
|
|
}, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps, null, {withRef: true})(PostTextbox);
|