forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLT-6406 Migrate new channel modal to be pure and use redux (mattermo…
…st#6416) * Migrate new channel modal to be pure and use redux * Add component tests
- Loading branch information
1 parent
f34d139
commit 4531b6e
Showing
6 changed files
with
910 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.