diff --git a/app/components/at_mention/index.js b/app/components/at_mention/index.js index 09f22aea7..f3a5d412f 100644 --- a/app/components/at_mention/index.js +++ b/app/components/at_mention/index.js @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getUsersByUsername} from 'mattermost-redux/selectors/entities/users'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import AtMention from './at_mention'; diff --git a/app/components/autocomplete/at_mention/index.js b/app/components/autocomplete/at_mention/index.js index f0766b5f7..f6b5c1435 100644 --- a/app/components/autocomplete/at_mention/index.js +++ b/app/components/autocomplete/at_mention/index.js @@ -14,7 +14,7 @@ import { filterMembersInCurrentTeam, getMatchTermForAtMention } from 'app/selectors/autocomplete'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import AtMention from './at_mention'; diff --git a/app/components/autocomplete/at_mention_item/index.js b/app/components/autocomplete/at_mention_item/index.js index 93f0de737..001ca7e45 100644 --- a/app/components/autocomplete/at_mention_item/index.js +++ b/app/components/autocomplete/at_mention_item/index.js @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getUser} from 'mattermost-redux/selectors/entities/users'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import AtMentionItem from './at_mention_item'; diff --git a/app/components/autocomplete/channel_mention/index.js b/app/components/autocomplete/channel_mention/index.js index 23c5be00f..54c3740b8 100644 --- a/app/components/autocomplete/channel_mention/index.js +++ b/app/components/autocomplete/channel_mention/index.js @@ -15,7 +15,7 @@ import { filterPrivateChannels, getMatchTermForChannelMention } from 'app/selectors/autocomplete'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelMention from './channel_mention'; diff --git a/app/components/autocomplete/channel_mention_item/index.js b/app/components/autocomplete/channel_mention_item/index.js index dc248578b..cd48c13d8 100644 --- a/app/components/autocomplete/channel_mention_item/index.js +++ b/app/components/autocomplete/channel_mention_item/index.js @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelMentionItem from './channel_mention_item'; diff --git a/app/components/autocomplete/emoji_suggestion/index.js b/app/components/autocomplete/emoji_suggestion/index.js index dce939e2a..81ea1d342 100644 --- a/app/components/autocomplete/emoji_suggestion/index.js +++ b/app/components/autocomplete/emoji_suggestion/index.js @@ -8,7 +8,7 @@ import {bindActionCreators} from 'redux'; import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'; import {addReactionToLatestPost} from 'app/actions/views/emoji'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {EmojiIndicesByAlias} from 'app/utils/emojis'; import EmojiSuggestion from './emoji_suggestion'; diff --git a/app/components/channel_drawer/channels_list/index.js b/app/components/channel_drawer/channels_list/index.js index 8080717c4..8e5849af6 100644 --- a/app/components/channel_drawer/channels_list/index.js +++ b/app/components/channel_drawer/channels_list/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelsList from './channels_list'; diff --git a/app/components/channel_drawer/index.js b/app/components/channel_drawer/index.js index 0a09c0855..cd4ab1d66 100644 --- a/app/components/channel_drawer/index.js +++ b/app/components/channel_drawer/index.js @@ -12,7 +12,7 @@ import {getCurrentTeamId, getTeamMemberships} from 'mattermost-redux/selectors/e import {handleSelectChannel, setChannelDisplayName, setChannelLoading} from 'app/actions/views/channel'; import {makeDirectChannel} from 'app/actions/views/more_dms'; import {isLandscape, isTablet} from 'app/selectors/device'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelDrawer from './channel_drawer.js'; diff --git a/app/components/channel_drawer/teams_list/index.js b/app/components/channel_drawer/teams_list/index.js index 001793753..debb190ab 100644 --- a/app/components/channel_drawer/teams_list/index.js +++ b/app/components/channel_drawer/teams_list/index.js @@ -8,7 +8,7 @@ import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general'; import {getCurrentTeamId, getJoinableTeams} from 'mattermost-redux/selectors/entities/teams'; import {handleTeamChange} from 'app/actions/views/select_team'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getMySortedTeams} from 'app/selectors/teams'; import {removeProtocol} from 'app/utils/url'; diff --git a/app/components/channel_intro/index.js b/app/components/channel_intro/index.js index 8763f74f3..78224f0d7 100644 --- a/app/components/channel_intro/index.js +++ b/app/components/channel_intro/index.js @@ -6,7 +6,7 @@ import {General, RequestStatus} from 'mattermost-redux/constants'; import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; import {getCurrentUser, getProfilesInCurrentChannel} from 'mattermost-redux/selectors/entities/users'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelIntro from './channel_intro'; diff --git a/app/components/channel_loader/index.js b/app/components/channel_loader/index.js index 0e5d93b75..1627ff8fa 100644 --- a/app/components/channel_loader/index.js +++ b/app/components/channel_loader/index.js @@ -2,7 +2,7 @@ // See License.txt for license information. import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelLoader from './channel_loader'; diff --git a/app/components/custom_list/channel_list_row/index.js b/app/components/custom_list/channel_list_row/index.js index c5d27a479..679c74234 100644 --- a/app/components/custom_list/channel_list_row/index.js +++ b/app/components/custom_list/channel_list_row/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {makeGetChannel} from 'mattermost-redux/selectors/entities/channels'; diff --git a/app/components/custom_list/user_list_row/index.js b/app/components/custom_list/user_list_row/index.js index b693da27b..fb0d0370e 100644 --- a/app/components/custom_list/user_list_row/index.js +++ b/app/components/custom_list/user_list_row/index.js @@ -3,9 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; - -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getUser} from 'mattermost-redux/selectors/entities/users'; import UserListRow from './user_list_row'; diff --git a/app/components/emoji_picker/index.js b/app/components/emoji_picker/index.js index e43943835..5dc97406a 100644 --- a/app/components/emoji_picker/index.js +++ b/app/components/emoji_picker/index.js @@ -7,7 +7,7 @@ import {createSelector} from 'reselect'; import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'; import {getDimensions} from 'app/selectors/device'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {CategoryNames, Emojis, EmojiIndicesByCategory} from 'app/utils/emojis'; import EmojiPicker from './emoji_picker'; diff --git a/app/components/error_text.js b/app/components/error_text.js index ae3ddae6d..aa1ac72de 100644 --- a/app/components/error_text.js +++ b/app/components/error_text.js @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'; import {Text} from 'react-native'; import FormattedText from 'app/components/formatted_text'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {GlobalStyles} from 'app/styles'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; diff --git a/app/components/file_attachment_list/index.js b/app/components/file_attachment_list/index.js index 83ed7b8b4..21c39dcc1 100644 --- a/app/components/file_attachment_list/index.js +++ b/app/components/file_attachment_list/index.js @@ -7,7 +7,7 @@ import {connect} from 'react-redux'; import {makeGetFilesForPost} from 'mattermost-redux/selectors/entities/files'; import {loadFilesForPostIfNecessary} from 'app/actions/views/channel'; import {addFileToFetchCache} from 'app/actions/views/file_preview'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import FileAttachmentList from './file_attachment_list'; diff --git a/app/components/file_upload_preview/index.js b/app/components/file_upload_preview/index.js index 5d5f75d07..b32fc7fc0 100644 --- a/app/components/file_upload_preview/index.js +++ b/app/components/file_upload_preview/index.js @@ -8,7 +8,7 @@ import {createSelector} from 'reselect'; import {handleRemoveFile, retryFileUpload} from 'app/actions/views/file_upload'; import {addFileToFetchCache} from 'app/actions/views/file_preview'; import {getDimensions} from 'app/selectors/device'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import FileUploadPreview from './file_upload_preview'; diff --git a/app/components/markdown/markdown_code_block/index.js b/app/components/markdown/markdown_code_block/index.js index d71e7bc8a..85ed0701e 100644 --- a/app/components/markdown/markdown_code_block/index.js +++ b/app/components/markdown/markdown_code_block/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import MarkdownCodeBlock from './markdown_code_block'; diff --git a/app/components/post/index.js b/app/components/post/index.js index 305e299bf..a564abf45 100644 --- a/app/components/post/index.js +++ b/app/components/post/index.js @@ -8,7 +8,7 @@ import {addReaction, createPost, deletePost, removePost} from 'mattermost-redux/ import {getPost} from 'mattermost-redux/selectors/entities/posts'; import {getCurrentUserId, getCurrentUserRoles} from 'mattermost-redux/selectors/entities/users'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import Post from './post'; diff --git a/app/components/post_body/index.js b/app/components/post_body/index.js index c1ff4ce99..24ce72de4 100644 --- a/app/components/post_body/index.js +++ b/app/components/post_body/index.js @@ -7,11 +7,9 @@ import {bindActionCreators} from 'redux'; import {flagPost, unflagPost} from 'mattermost-redux/actions/posts'; import {Posts} from 'mattermost-redux/constants'; import {getPost} from 'mattermost-redux/selectors/entities/posts'; -import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; +import {getMyPreferences, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {isPostFlagged, isPostEphemeral, isSystemMessage} from 'mattermost-redux/utils/post_utils'; -import {getTheme} from 'app/selectors/preferences'; - import PostBody from './post_body'; function mapStateToProps(state, ownProps) { diff --git a/app/components/post_body_additional_content/index.js b/app/components/post_body_additional_content/index.js index 1921d14c0..9750744e2 100644 --- a/app/components/post_body_additional_content/index.js +++ b/app/components/post_body_additional_content/index.js @@ -9,11 +9,10 @@ import {connect} from 'react-redux'; import {Preferences} from 'mattermost-redux/constants'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getOpenGraphMetadataForUrl} from 'mattermost-redux/selectors/entities/posts'; -import {getBool} from 'mattermost-redux/selectors/entities/preferences'; +import {getBool, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {ViewTypes} from 'app/constants'; import {getDimensions} from 'app/selectors/device'; -import {getTheme} from 'app/selectors/preferences'; import {extractFirstLink} from 'app/utils/url'; import PostBodyAdditionalContent from './post_body_additional_content'; diff --git a/app/components/post_header/index.js b/app/components/post_header/index.js index e0083514c..49660f117 100644 --- a/app/components/post_header/index.js +++ b/app/components/post_header/index.js @@ -5,13 +5,11 @@ import {connect} from 'react-redux'; import {Preferences} from 'mattermost-redux/constants'; import {getPost, makeGetCommentCountForPost} from 'mattermost-redux/selectors/entities/posts'; -import {getBool, getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {getBool, getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getUser} from 'mattermost-redux/selectors/entities/users'; import {isPostPendingOrFailed, isSystemMessage} from 'mattermost-redux/utils/post_utils'; import {displayUsername} from 'mattermost-redux/utils/user_utils'; -import {getTheme} from 'app/selectors/preferences'; - import PostHeader from './post_header'; function makeMapStateToProps() { diff --git a/app/components/post_list/index.js b/app/components/post_list/index.js index d9b3d664f..61db323c5 100644 --- a/app/components/post_list/index.js +++ b/app/components/post_list/index.js @@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {refreshChannelWithRetry} from 'app/actions/views/channel'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import PostList from './post_list'; diff --git a/app/components/post_profile_picture/index.js b/app/components/post_profile_picture/index.js index 4db425d98..b29949b18 100644 --- a/app/components/post_profile_picture/index.js +++ b/app/components/post_profile_picture/index.js @@ -6,7 +6,7 @@ import {connect} from 'react-redux'; import {getPost} from 'mattermost-redux/selectors/entities/posts'; import {isSystemMessage} from 'mattermost-redux/utils/post_utils'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import PostProfilePicture from './post_profile_picture'; diff --git a/app/components/post_textbox/components/typing/index.js b/app/components/post_textbox/components/typing/index.js index 220559627..4c51c8aef 100644 --- a/app/components/post_textbox/components/typing/index.js +++ b/app/components/post_textbox/components/typing/index.js @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getUsersTyping} from 'mattermost-redux/selectors/entities/typing'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import Typing from './typing'; diff --git a/app/components/post_textbox/index.js b/app/components/post_textbox/index.js index 4e4e93a23..9bff4986e 100644 --- a/app/components/post_textbox/index.js +++ b/app/components/post_textbox/index.js @@ -14,7 +14,7 @@ import {addReactionToLatestPost} from 'app/actions/views/emoji'; import {handlePostDraftChanged} from 'app/actions/views/channel'; import {handleClearFiles, handleRemoveLastFile, handleUploadFiles} from 'app/actions/views/file_upload'; import {handleCommentDraftChanged} from 'app/actions/views/thread'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentChannelDraft, getThreadDraft} from 'app/selectors/views'; import PostTextbox from './post_textbox'; diff --git a/app/components/profile_picture/index.js b/app/components/profile_picture/index.js index 15e940559..bbcae7d2e 100644 --- a/app/components/profile_picture/index.js +++ b/app/components/profile_picture/index.js @@ -4,7 +4,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getStatusesByIdsBatchedDebounced} from 'mattermost-redux/actions/users'; import {getStatusForUserId, getUser} from 'mattermost-redux/selectors/entities/users'; diff --git a/app/components/radio_button/radio_button.js b/app/components/radio_button/radio_button.js index 74f0ef043..255cef3eb 100644 --- a/app/components/radio_button/radio_button.js +++ b/app/components/radio_button/radio_button.js @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'; import {Animated, Text, View} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialIcons'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; const DISABLED_OPACITY = 0.26; diff --git a/app/components/reactions/index.js b/app/components/reactions/index.js index 9921d3bd4..70467cac4 100644 --- a/app/components/reactions/index.js +++ b/app/components/reactions/index.js @@ -8,7 +8,7 @@ import {addReaction, getReactionsForPost, removeReaction} from 'mattermost-redux import {makeGetReactionsForPost} from 'mattermost-redux/selectors/entities/posts'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import Reactions from './reactions'; diff --git a/app/components/root/index.js b/app/components/root/index.js index 68509e281..7176621ac 100644 --- a/app/components/root/index.js +++ b/app/components/root/index.js @@ -8,7 +8,7 @@ import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels' import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general'; import {getCurrentLocale} from 'app/selectors/i18n'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {removeProtocol} from 'app/utils/url'; import Root from './root'; diff --git a/app/components/status_bar/index.js b/app/components/status_bar/index.js index 2f7b93705..ff91e788d 100644 --- a/app/components/status_bar/index.js +++ b/app/components/status_bar/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import StatusBar from './status_bar'; diff --git a/app/screens/about/index.js b/app/screens/about/index.js index 7e71da098..4eccffbf5 100644 --- a/app/screens/about/index.js +++ b/app/screens/about/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import About from './about'; diff --git a/app/screens/channel/channel_drawer_button.js b/app/screens/channel/channel_drawer_button.js index 6d79b0a17..2252e5a1f 100644 --- a/app/screens/channel/channel_drawer_button.js +++ b/app/screens/channel/channel_drawer_button.js @@ -15,7 +15,7 @@ import Icon from 'react-native-vector-icons/Ionicons'; import Badge from 'app/components/badge'; import PushNotifications from 'app/push_notifications'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {preventDoubleTap} from 'app/utils/tap'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; diff --git a/app/screens/channel/channel_post_list/index.js b/app/screens/channel/channel_post_list/index.js index 811536d2a..432060ed4 100644 --- a/app/screens/channel/channel_post_list/index.js +++ b/app/screens/channel/channel_post_list/index.js @@ -10,7 +10,7 @@ import {makeGetPostsInChannel} from 'mattermost-redux/selectors/entities/posts'; import {getCurrentChannelId, getMyCurrentChannelMembership, makeGetChannel} from 'mattermost-redux/selectors/entities/channels'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import {loadPostsIfNecessaryWithRetry, loadThreadIfNecessary, increasePostVisibility, refreshChannelWithRetry} from 'app/actions/views/channel'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelPostList from './channel_post_list'; diff --git a/app/screens/channel/channel_title/index.js b/app/screens/channel/channel_title/index.js index beed6c218..c7cabb106 100644 --- a/app/screens/channel/channel_title/index.js +++ b/app/screens/channel/channel_title/index.js @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import ChannelTitle from './channel_title'; diff --git a/app/screens/channel/index.js b/app/screens/channel/index.js index 3a14c106e..3893fd5cb 100644 --- a/app/screens/channel/index.js +++ b/app/screens/channel/index.js @@ -18,7 +18,7 @@ import { } from 'app/actions/views/channel'; import {connection} from 'app/actions/device'; import {selectFirstAvailableTeam} from 'app/actions/views/select_team'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import Channel from './channel'; diff --git a/app/screens/channel_add_members/index.js b/app/screens/channel_add_members/index.js index 43d07eb9d..fb06dc4a9 100644 --- a/app/screens/channel_add_members/index.js +++ b/app/screens/channel_add_members/index.js @@ -5,9 +5,8 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {handleAddChannelMembers} from 'app/actions/views/channel_add_members'; -import {getTheme} from 'app/selectors/preferences'; import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; +import {getMyPreferences, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {getProfilesNotInCurrentChannel} from 'mattermost-redux/selectors/entities/users'; import {getTeamStats} from 'mattermost-redux/actions/teams'; diff --git a/app/screens/channel_info/index.js b/app/screens/channel_info/index.js index 5b42ae77c..193d72660 100644 --- a/app/screens/channel_info/index.js +++ b/app/screens/channel_info/index.js @@ -9,7 +9,7 @@ import { closeGMChannel, leaveChannel } from 'app/actions/views/channel'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {favoriteChannel, getChannelStats, deleteChannel, unfavoriteChannel} from 'mattermost-redux/actions/channels'; import {General} from 'mattermost-redux/constants'; diff --git a/app/screens/channel_members/index.js b/app/screens/channel_members/index.js index 5e5f192b9..b1444c1b9 100644 --- a/app/screens/channel_members/index.js +++ b/app/screens/channel_members/index.js @@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {handleRemoveChannelMembers} from 'app/actions/views/channel_members'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentChannel, canManageChannelMembers} from 'mattermost-redux/selectors/entities/channels'; import {getProfilesInCurrentChannel} from 'mattermost-redux/selectors/entities/users'; import {getProfilesInChannel, searchProfiles} from 'mattermost-redux/actions/users'; diff --git a/app/screens/code/index.js b/app/screens/code/index.js index 1eee46321..cbd69d8de 100644 --- a/app/screens/code/index.js +++ b/app/screens/code/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import Code from './code'; diff --git a/app/screens/create_channel/index.js b/app/screens/create_channel/index.js index e4ce5311c..966d4e405 100644 --- a/app/screens/create_channel/index.js +++ b/app/screens/create_channel/index.js @@ -6,7 +6,7 @@ import {connect} from 'react-redux'; import {handleCreateChannel} from 'app/actions/views/create_channel'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import CreateChannel from './create_channel'; diff --git a/app/screens/edit_post/index.js b/app/screens/edit_post/index.js index a2c3b5e14..5310b0f3c 100644 --- a/app/screens/edit_post/index.js +++ b/app/screens/edit_post/index.js @@ -4,7 +4,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {editPost} from 'mattermost-redux/actions/posts'; diff --git a/app/screens/image_preview/index.js b/app/screens/image_preview/index.js index 2b1ef2f6e..70013f7ab 100644 --- a/app/screens/image_preview/index.js +++ b/app/screens/image_preview/index.js @@ -7,7 +7,7 @@ import {Platform} from 'react-native'; import {addFileToFetchCache} from 'app/actions/views/file_preview'; import {getDimensions, getStatusBarHeight} from 'app/selectors/device'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {canDownloadFilesOnMobile} from 'mattermost-redux/selectors/entities/general'; import {makeGetFilesForPost} from 'mattermost-redux/selectors/entities/files'; diff --git a/app/screens/load_team/index.js b/app/screens/load_team/index.js index 4352a67c7..a23abbd4b 100644 --- a/app/screens/load_team/index.js +++ b/app/screens/load_team/index.js @@ -10,7 +10,7 @@ import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {initialize} from 'app/actions/views/load_team'; import {clearNotification, goToNotification} from 'app/actions/views/root'; import {handleTeamChange} from 'app/actions/views/select_team'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import LoadTeam from './load_team'; diff --git a/app/screens/login/index.js b/app/screens/login/index.js index 051b62003..168198423 100644 --- a/app/screens/login/index.js +++ b/app/screens/login/index.js @@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import LoginActions from 'app/actions/views/login'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {checkMfa, login} from 'mattermost-redux/actions/users'; diff --git a/app/screens/login_options/index.js b/app/screens/login_options/index.js index 79ea4d866..5c2f90601 100644 --- a/app/screens/login_options/index.js +++ b/app/screens/login_options/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import LoginOptions from './login_options'; diff --git a/app/screens/more_channels/index.js b/app/screens/more_channels/index.js index 92452bd81..35a0eae41 100644 --- a/app/screens/more_channels/index.js +++ b/app/screens/more_channels/index.js @@ -13,7 +13,7 @@ import {showCreateOption} from 'mattermost-redux/utils/channel_utils'; import {isAdmin, isSystemAdmin} from 'mattermost-redux/utils/user_utils'; import {handleSelectChannel, setChannelDisplayName} from 'app/actions/views/channel'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import MoreChannels from './more_channels'; diff --git a/app/screens/more_dms/index.js b/app/screens/more_dms/index.js index 839fb6870..98c281076 100644 --- a/app/screens/more_dms/index.js +++ b/app/screens/more_dms/index.js @@ -7,12 +7,11 @@ import {createSelector} from 'reselect'; import {setChannelDisplayName} from 'app/actions/views/channel'; import {makeDirectChannel, makeGroupChannel} from 'app/actions/views/more_dms'; -import {getTheme} from 'app/selectors/preferences'; import {getProfiles, getProfilesInTeam, searchProfiles} from 'mattermost-redux/actions/users'; import {General} from 'mattermost-redux/constants'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUserId, getProfilesInCurrentTeam, getUsers} from 'mattermost-redux/selectors/entities/users'; diff --git a/app/screens/more_dms/selected_users/index.js b/app/screens/more_dms/selected_users/index.js index dfa68f826..443f4a68c 100644 --- a/app/screens/more_dms/selected_users/index.js +++ b/app/screens/more_dms/selected_users/index.js @@ -3,9 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; - -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getUsers} from 'mattermost-redux/selectors/entities/users'; import SelectedUsers from './selected_users'; diff --git a/app/screens/notification/index.js b/app/screens/notification/index.js index e233f283b..d2923ae5a 100644 --- a/app/screens/notification/index.js +++ b/app/screens/notification/index.js @@ -6,10 +6,9 @@ import {connect} from 'react-redux'; import {goToNotification} from 'app/actions/views/root'; import {getDimensions} from 'app/selectors/device'; -import {getTheme} from 'app/selectors/preferences'; import {getChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getUser} from 'mattermost-redux/selectors/entities/users'; import Notification from './notification'; diff --git a/app/screens/root/index.js b/app/screens/root/index.js index d2af2aa99..5124c9545 100644 --- a/app/screens/root/index.js +++ b/app/screens/root/index.js @@ -6,7 +6,7 @@ import {connect} from 'react-redux'; import {loadMe} from 'mattermost-redux/actions/users'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import Root from './root'; diff --git a/app/screens/select_server/index.js b/app/screens/select_server/index.js index 098929fa0..5e9ea74d8 100644 --- a/app/screens/select_server/index.js +++ b/app/screens/select_server/index.js @@ -8,7 +8,7 @@ import {getPing, resetPing} from 'mattermost-redux/actions/general'; import {RequestStatus} from 'mattermost-redux/constants'; import {handleServerUrlChanged} from 'app/actions/views/select_server'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import SelectServer from './select_server'; diff --git a/app/screens/settings/advanced_settings/index.js b/app/screens/settings/advanced_settings/index.js index c12ccf971..b14f66b59 100644 --- a/app/screens/settings/advanced_settings/index.js +++ b/app/screens/settings/advanced_settings/index.js @@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {purgeOfflineStore} from 'app/actions/views/root'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import AdvancedSettings from './advanced_settings'; diff --git a/app/screens/settings/general/index.js b/app/screens/settings/general/index.js index c392e394a..ecca24c18 100644 --- a/app/screens/settings/general/index.js +++ b/app/screens/settings/general/index.js @@ -10,7 +10,7 @@ import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general'; import {getJoinableTeams} from 'mattermost-redux/selectors/entities/teams'; import {purgeOfflineStore} from 'app/actions/views/root'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {removeProtocol} from 'app/utils/url'; import Settings from './settings'; diff --git a/app/screens/settings/notification_settings/index.js b/app/screens/settings/notification_settings/index.js index 8b7066008..b9adfb02a 100644 --- a/app/screens/settings/notification_settings/index.js +++ b/app/screens/settings/notification_settings/index.js @@ -5,10 +5,9 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; +import {getMyPreferences, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {handleUpdateUserNotifyProps} from 'app/actions/views/account_notifications'; -import {getTheme} from 'app/selectors/preferences'; import NotificationSettings from './notification_settings'; diff --git a/app/screens/settings/notification_settings_email/index.js b/app/screens/settings/notification_settings_email/index.js index 0b490e3eb..48ef2a279 100644 --- a/app/screens/settings/notification_settings_email/index.js +++ b/app/screens/settings/notification_settings_email/index.js @@ -4,9 +4,7 @@ import {connect} from 'react-redux'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; - -import {getTheme} from 'app/selectors/preferences'; +import {getMyPreferences, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import NotificationSettingsEmail from './notification_settings_email'; diff --git a/app/screens/settings/notification_settings_mentions/index.js b/app/screens/settings/notification_settings_mentions/index.js index e823f0239..0d946284e 100644 --- a/app/screens/settings/notification_settings_mentions/index.js +++ b/app/screens/settings/notification_settings_mentions/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import NotificationSettingsMentions from './notification_settings_mentions'; diff --git a/app/screens/settings/notification_settings_mentions_keywords/index.js b/app/screens/settings/notification_settings_mentions_keywords/index.js index 7fe120834..61fb1faaa 100644 --- a/app/screens/settings/notification_settings_mentions_keywords/index.js +++ b/app/screens/settings/notification_settings_mentions_keywords/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import NotificationSettingsMentionsKeywords from './notification_settings_mentions_keywords'; diff --git a/app/screens/settings/notification_settings_mobile/index.js b/app/screens/settings/notification_settings_mobile/index.js index 9b57e5c38..329a54ab1 100644 --- a/app/screens/settings/notification_settings_mobile/index.js +++ b/app/screens/settings/notification_settings_mobile/index.js @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import NotificationSettingsMobile from './notification_settings_mobile'; diff --git a/app/screens/sso/index.js b/app/screens/sso/index.js index ee460bbfc..c9075e799 100644 --- a/app/screens/sso/index.js +++ b/app/screens/sso/index.js @@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {getSession, handleSuccessfulLogin} from 'app/actions/views/login'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {setStoreFromLocalData} from 'mattermost-redux/actions/general'; diff --git a/app/screens/thread/index.js b/app/screens/thread/index.js index 918b5b95f..91ab40bc0 100644 --- a/app/screens/thread/index.js +++ b/app/screens/thread/index.js @@ -4,7 +4,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; -import {getTheme} from 'app/selectors/preferences'; +import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {selectPost} from 'mattermost-redux/actions/posts'; import {makeGetPostsForThread} from 'mattermost-redux/selectors/entities/posts'; diff --git a/app/screens/user_profile/index.js b/app/screens/user_profile/index.js index f2b3dbea2..8a4f7a264 100644 --- a/app/screens/user_profile/index.js +++ b/app/screens/user_profile/index.js @@ -6,10 +6,9 @@ import {connect} from 'react-redux'; import {setChannelDisplayName} from 'app/actions/views/channel'; import {makeDirectChannel} from 'app/actions/views/more_dms'; -import {getTheme} from 'app/selectors/preferences'; import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import UserProfile from './user_profile'; diff --git a/app/selectors/preferences.js b/app/selectors/preferences.js deleted file mode 100644 index 9fd849946..000000000 --- a/app/selectors/preferences.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import {createSelector} from 'reselect'; - -import Config from 'assets/config.json'; -import Themes from 'assets/themes.json'; - -import {Preferences} from 'mattermost-redux/constants'; -import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; - -import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; - -export const getTheme = createSelector( - getMyPreferences, - getCurrentTeamId, - (myPreferences, currentTeamId) => { - // Prefer the user's current team-specific theme over the user's current global theme over the default theme - let themePreference; - if (currentTeamId) { - themePreference = myPreferences[getPreferenceKey(Preferences.CATEGORY_THEME, currentTeamId)]; - } - - if (!themePreference) { - themePreference = myPreferences[getPreferenceKey(Preferences.CATEGORY_THEME, '')]; - } - - let theme; - if (themePreference) { - theme = themePreference.value; - } else { - theme = Config.DefaultTheme; - } - - if (typeof theme === 'string') { - try { - // A custom theme will be a JSON-serialized object stored in a preference - theme = JSON.parse(theme); - } catch (e) { - // But if it's not a JSON object, it must be the name of a default theme - theme = Themes[theme]; - } - } - - // At this point, the theme should be a plain object - - // Fix a case where upper case theme colours are rendered as black - if (currentTeamId) { - for (const key of Object.keys(theme)) { - theme[key] = theme[key].toLowerCase(); - } - } - - return theme; - } -); diff --git a/yarn.lock b/yarn.lock index c6fb464d0..d45191260 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3878,7 +3878,7 @@ makeerror@1.0.x: mattermost-redux@mattermost/mattermost-redux#master: version "0.0.1" - resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/6932c3fd4064434c5b30cff9898d724cdc687648" + resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/3f8bad7d1569949e0c7eeabac91bad06bfe7c1c3" dependencies: deep-equal "1.0.1" harmony-reflect "1.5.1"