diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-05-17 11:29:41 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-05-17 08:29:41 -0700 |
commit | 017cd2a9575149bb87f382f441b9c960b6816c9d (patch) | |
tree | cc1530ac9ab8796bf67f85eb11fa3aba114fd3df /webapp/components/new_channel_modal/index.js | |
parent | a84a300947e3995945db2789dbf062c2e18c7b8e (diff) | |
download | chat-017cd2a9575149bb87f382f441b9c960b6816c9d.tar.gz chat-017cd2a9575149bb87f382f441b9c960b6816c9d.tar.bz2 chat-017cd2a9575149bb87f382f441b9c960b6816c9d.zip |
PLT-6406 Migrate new channel modal to be pure and use redux (#6416)
* Migrate new channel modal to be pure and use redux
* Add component tests
Diffstat (limited to 'webapp/components/new_channel_modal/index.js')
-rw-r--r-- | webapp/components/new_channel_modal/index.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/webapp/components/new_channel_modal/index.js b/webapp/components/new_channel_modal/index.js new file mode 100644 index 000000000..770084fbb --- /dev/null +++ b/webapp/components/new_channel_modal/index.js @@ -0,0 +1,21 @@ +// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import {connect} from 'react-redux'; +import {getBool} from 'mattermost-redux/selectors/entities/preferences'; +import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; +import {isCurrentUserCurrentTeamAdmin} from 'mattermost-redux/selectors/entities/teams'; +import {Preferences} from 'mattermost-redux/constants'; + +import NewChannelModal from './new_channel_modal.jsx'; + +function mapStateToProps(state, ownProps) { + return { + ...ownProps, + ctrlSend: getBool(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter'), + isTeamAdmin: isCurrentUserCurrentTeamAdmin(state), + isSystemAdmin: isCurrentUserSystemAdmin(state) + }; +} + +export default connect(mapStateToProps)(NewChannelModal); |