* 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
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {
|
|
loadChannelsIfNecessary,
|
|
loadProfilesAndTeamMembersForDMSidebar,
|
|
selectInitialChannel,
|
|
handlePostDraftChanged
|
|
} from 'app/actions/views/channel';
|
|
import {openChannelDrawer} from 'app/actions/views/drawer';
|
|
|
|
import {getCurrentChannel} from 'service/selectors/entities/channels';
|
|
import {getTheme} from 'service/selectors/entities/preferences';
|
|
import {getCurrentTeam} from 'service/selectors/entities/teams';
|
|
|
|
import Channel from './channel';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
return {
|
|
...ownProps,
|
|
...state.views.channel,
|
|
currentTeam: getCurrentTeam(state),
|
|
currentChannel: getCurrentChannel(state),
|
|
theme: getTheme(state)
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
loadChannelsIfNecessary,
|
|
loadProfilesAndTeamMembersForDMSidebar,
|
|
selectInitialChannel,
|
|
openChannelDrawer,
|
|
handlePostDraftChanged
|
|
}, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Channel);
|