From bdf83e546efa14a2b0e42de137d69ae041c4e1ef Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Thu, 7 Apr 2022 11:10:03 -0300 Subject: [PATCH] Chore: Move constants away from rocketchat folder - Typescript (#4022) * create keys file and export all consts * fix import E2E_MESSAGE_TYPE * fix constants import * fix constants import * fix E2E_BANNER_TYPE import * fix E2E_ROOM_TYPES import * fix THEME_PREFERENCES_KEY import * fix CRASH_REPORT_KEY and ANALYTICS_EVENTS_KEY import * fix MIN_ROCKETCHAT_VERSION import * fix constantDisplayMode import * fix environment imports * fix links imports * fix localAuthentication imports * fix localPath imports * fix messagesStatus imports * fix messageTypeLoad imports * fix defaultSettings imports * fix tablet imports * update with todo for colors * move to lib folder * change constant/colors to constant --- app/containers/ActionSheet/ActionSheet.tsx | 2 +- app/containers/ActionSheet/Handle.tsx | 2 +- app/containers/ActionSheet/Item.tsx | 2 +- app/containers/ActivityIndicator.tsx | 2 +- app/containers/AppVersion.tsx | 2 +- app/containers/BackgroundContainer/index.tsx | 2 +- app/containers/Button/index.tsx | 2 +- app/containers/Check.tsx | 2 +- app/containers/EmojiPicker/TabBar.tsx | 2 +- app/containers/EmojiPicker/index.tsx | 2 +- app/containers/FormContainer.tsx | 2 +- app/containers/Header/index.tsx | 2 +- app/containers/HeaderButton/HeaderButtonItem.tsx | 2 +- .../InAppNotification/NotifierComponent.tsx | 2 +- app/containers/List/ListHeader.tsx | 2 +- app/containers/List/ListIcon.tsx | 2 +- app/containers/List/ListInfo.tsx | 2 +- app/containers/List/ListItem.tsx | 2 +- app/containers/List/ListSeparator.tsx | 2 +- app/containers/Loading.tsx | 2 +- app/containers/LoginServices.tsx | 2 +- app/containers/MessageActions/Header.tsx | 2 +- app/containers/MessageBox/CommandsPreview/Item.tsx | 2 +- app/containers/MessageBox/CommandsPreview/index.tsx | 2 +- app/containers/MessageBox/EmojiKeyboard.tsx | 2 +- .../MessageBox/Mentions/FixedMentionItem.tsx | 2 +- .../MessageBox/Mentions/MentionHeaderList.tsx | 4 ++-- app/containers/MessageBox/Mentions/MentionItem.tsx | 2 +- app/containers/MessageBox/Mentions/index.tsx | 2 +- app/containers/MessageBox/RecordAudio.tsx | 2 +- app/containers/MessageBox/ReplyPreview.tsx | 2 +- app/containers/MessageBox/buttons/BaseButton.tsx | 2 +- app/containers/MessageBox/buttons/SendButton.tsx | 2 +- app/containers/MessageBox/index.tsx | 2 +- app/containers/OrSeparator.tsx | 2 +- app/containers/Passcode/Base/Button.tsx | 2 +- app/containers/Passcode/Base/Dots.tsx | 2 +- app/containers/Passcode/Base/LockIcon.tsx | 2 +- app/containers/Passcode/Base/Locked.tsx | 2 +- app/containers/Passcode/Base/Subtitle.tsx | 2 +- app/containers/Passcode/Base/Title.tsx | 2 +- app/containers/Passcode/Base/index.tsx | 3 +-- app/containers/Passcode/PasscodeEnter.tsx | 2 +- app/containers/Passcode/utils.ts | 2 +- app/containers/ReactionsModal.tsx | 2 +- app/containers/RoomHeader/RoomHeader.tsx | 2 +- app/containers/RoomTypeIcon.tsx | 2 +- app/containers/SafeAreaView.tsx | 2 +- app/containers/SearchBox.tsx | 2 +- app/containers/SearchHeader.tsx | 2 +- app/containers/Status/Status.tsx | 2 +- app/containers/StatusBar.tsx | 2 +- app/containers/TextInput.tsx | 2 +- app/containers/ThreadDetails.tsx | 2 +- app/containers/Toast.tsx | 2 +- app/containers/TwoFactor/index.tsx | 2 +- app/containers/UIKit/DatePicker.tsx | 2 +- app/containers/UIKit/Input.tsx | 2 +- app/containers/UIKit/MultiSelect/Chips.tsx | 2 +- app/containers/UIKit/MultiSelect/Input.tsx | 2 +- app/containers/UIKit/MultiSelect/Items.tsx | 2 +- app/containers/UIKit/MultiSelect/index.tsx | 2 +- app/containers/UIKit/Overflow.tsx | 2 +- app/containers/UIKit/Section.tsx | 2 +- app/containers/UIKit/Select.tsx | 2 +- app/containers/UIKit/index.tsx | 2 +- app/containers/markdown/AtMention.tsx | 2 +- app/containers/markdown/BlockQuote.tsx | 2 +- app/containers/markdown/Emoji.tsx | 2 +- app/containers/markdown/Hashtag.tsx | 2 +- app/containers/markdown/Link.tsx | 2 +- app/containers/markdown/ListItem.tsx | 2 +- app/containers/markdown/Preview.tsx | 2 +- app/containers/markdown/Table.tsx | 2 +- app/containers/markdown/TableCell.tsx | 2 +- app/containers/markdown/TableRow.tsx | 2 +- app/containers/markdown/index.tsx | 2 +- app/containers/markdown/new/Code.tsx | 2 +- app/containers/markdown/new/Emoji.tsx | 2 +- app/containers/markdown/new/Heading.tsx | 2 +- app/containers/markdown/new/Image.tsx | 2 +- app/containers/markdown/new/InlineCode.tsx | 2 +- app/containers/markdown/new/Link.tsx | 2 +- app/containers/markdown/new/OrderedList.tsx | 2 +- app/containers/markdown/new/Paragraph.tsx | 2 +- app/containers/markdown/new/Plain.tsx | 2 +- app/containers/markdown/new/Quote.tsx | 2 +- app/containers/markdown/new/TaskList.tsx | 2 +- app/containers/markdown/new/UnorderedList.tsx | 2 +- app/containers/message/Attachments.tsx | 2 +- app/containers/message/Audio.tsx | 2 +- app/containers/message/Broadcast.tsx | 2 +- app/containers/message/CallButton.tsx | 2 +- .../message/Components/CollapsibleQuote/index.tsx | 2 +- app/containers/message/Content.tsx | 3 +-- app/containers/message/Discussion.tsx | 2 +- app/containers/message/Encrypted.tsx | 3 +-- app/containers/message/Image.tsx | 2 +- app/containers/message/Message.tsx | 2 +- app/containers/message/MessageError.tsx | 2 +- app/containers/message/Reactions.tsx | 2 +- app/containers/message/ReadReceipt.tsx | 2 +- app/containers/message/RepliedThread.tsx | 2 +- app/containers/message/Reply.tsx | 2 +- app/containers/message/Thread.tsx | 2 +- app/containers/message/Urls.tsx | 2 +- app/containers/message/User.tsx | 2 +- app/containers/message/Video.tsx | 2 +- app/containers/message/index.tsx | 3 +-- app/definitions/IMessage.ts | 2 +- app/definitions/IPreferences.ts | 2 +- app/ee/omnichannel/containers/OmnichannelStatus.tsx | 2 +- app/ee/omnichannel/views/QueueListView.tsx | 4 +--- app/index.tsx | 4 +--- app/{ => lib}/constants/colors.ts | 0 app/{ => lib}/constants/constantDisplayMode.ts | 0 .../settings.ts => lib/constants/defaultSettings.ts} | 2 +- app/{ => lib}/constants/environment.ts | 0 app/lib/constants/index.ts | 11 +++++++++++ app/lib/{constants.ts => constants/keys.ts} | 0 app/{ => lib}/constants/links.ts | 2 +- app/{ => lib}/constants/localAuthentication.ts | 0 app/{ => lib}/constants/localPath.ts | 0 app/{ => lib}/constants/messageTypeLoad.ts | 0 app/{ => lib}/constants/messagesStatus.ts | 2 +- app/{ => lib}/constants/tablet.ts | 0 app/lib/database/index.ts | 2 +- app/lib/encryption/encryption.ts | 6 +++--- app/lib/encryption/room.ts | 2 +- app/lib/methods/helpers/buildMessage.ts | 2 +- app/lib/methods/loadMessagesForRoom.ts | 2 +- app/lib/methods/loadNextMessages.ts | 2 +- app/lib/methods/loadSurroundingMessages.ts | 2 +- app/lib/methods/sendMessage.ts | 3 +-- app/lib/methods/subscriptions/rooms.ts | 2 +- app/lib/methods/updateMessages.ts | 2 +- app/lib/rocketchat/methods/getSettings.ts | 5 ++--- app/lib/rocketchat/methods/helpers.ts | 3 +-- app/lib/rocketchat/methods/logout.ts | 2 +- app/lib/rocketchat/services/connect.ts | 3 +-- app/notifications/push/index.ts | 2 +- app/presentation/DirectoryItem/index.tsx | 2 +- app/presentation/ImageViewer/ImageViewer.android.tsx | 2 +- app/presentation/ImageViewer/ImageViewer.tsx | 2 +- app/presentation/RoomItem/Actions.tsx | 3 +-- app/presentation/RoomItem/IconOrAvatar.js | 2 +- app/presentation/RoomItem/LastMessage.tsx | 3 +-- app/presentation/RoomItem/RoomItem.tsx | 2 +- app/presentation/RoomItem/Tag.tsx | 2 +- app/presentation/RoomItem/Title.tsx | 2 +- app/presentation/RoomItem/Touchable.tsx | 2 +- app/presentation/RoomItem/UpdatedAt.tsx | 2 +- app/presentation/RoomItem/Wrapper.tsx | 3 +-- app/presentation/ServerItem/index.tsx | 2 +- app/presentation/TextInput.tsx | 2 +- app/presentation/UnreadBadge/getUnreadStyle.test.js | 2 +- app/presentation/UnreadBadge/getUnreadStyle.ts | 2 +- app/presentation/UserItem.tsx | 2 +- app/reducers/settings.ts | 4 ++-- app/reducers/sortPreferences.test.ts | 2 +- app/reducers/sortPreferences.ts | 2 +- app/sagas/encryption.js | 2 +- app/sagas/init.js | 2 +- app/share.tsx | 2 +- app/stacks/InsideStack.tsx | 2 +- app/stacks/MasterDetailStack/ModalContainer.tsx | 2 +- app/theme.tsx | 2 +- app/utils/fileDownload/index.ts | 2 +- app/utils/localAuthentication.ts | 2 +- app/utils/log/index.ts | 2 +- app/utils/navigation/index.ts | 2 +- app/utils/openLink.ts | 2 +- app/utils/review.ts | 3 +-- app/utils/room.ts | 2 +- app/utils/theme.ts | 5 ++--- app/utils/touch.tsx | 2 +- app/views/AddExistingChannelView.tsx | 2 +- app/views/AttachmentView.tsx | 2 +- app/views/AuthLoadingView.tsx | 2 +- app/views/AutoTranslateView/index.tsx | 2 +- app/views/CannedResponseDetail.tsx | 2 +- .../CannedResponsesListView/CannedResponseItem.tsx | 2 +- .../CannedResponsesListView/Dropdown/DropdownItem.tsx | 2 +- app/views/CannedResponsesListView/Dropdown/index.tsx | 2 +- app/views/CannedResponsesListView/index.tsx | 2 +- app/views/ChangePasscodeView.tsx | 3 +-- app/views/CreateChannelView.tsx | 2 +- app/views/CreateDiscussionView/SelectChannel.tsx | 2 +- app/views/CreateDiscussionView/SelectUsers.tsx | 2 +- app/views/CreateDiscussionView/index.tsx | 3 +-- app/views/DefaultBrowserView.tsx | 2 +- app/views/DirectoryView/Options.tsx | 2 +- app/views/DirectoryView/index.tsx | 2 +- app/views/DiscussionsView/DiscussionDetails.tsx | 2 +- app/views/DiscussionsView/Item.stories.js | 2 +- app/views/DiscussionsView/Item.tsx | 2 +- app/views/DiscussionsView/index.tsx | 2 +- app/views/DisplayPrefsView.tsx | 3 +-- app/views/E2EEncryptionSecurityView.tsx | 2 +- app/views/E2EEnterYourPasswordView.tsx | 2 +- app/views/E2EHowItWorksView.tsx | 2 +- app/views/E2ESaveYourPasswordView.tsx | 3 +-- app/views/ForgotPasswordView.tsx | 2 +- app/views/ForwardLivechatView.tsx | 2 +- app/views/InviteUsersEditView/index.tsx | 2 +- app/views/InviteUsersView/index.tsx | 2 +- app/views/LanguageView/index.tsx | 2 +- app/views/LivechatEditView.tsx | 2 +- app/views/LoginView.tsx | 2 +- app/views/MarkdownTableView.tsx | 2 +- app/views/MessagesView/index.tsx | 2 +- app/views/ModalBlockView.tsx | 2 +- app/views/NewMessageView.tsx | 2 +- app/views/NewServerView/ServerInput/Item.tsx | 2 +- app/views/NewServerView/ServerInput/index.tsx | 2 +- app/views/NewServerView/index.tsx | 2 +- app/views/NotificationPreferencesView/index.tsx | 2 +- app/views/PickerView.tsx | 2 +- app/views/ProfileView/index.tsx | 2 +- app/views/ReadReceiptView/index.tsx | 2 +- app/views/RegisterView.tsx | 2 +- app/views/RoomActionsView/index.tsx | 3 +-- app/views/RoomInfoEditView/SwitchContainer.tsx | 2 +- app/views/RoomInfoEditView/index.tsx | 2 +- app/views/RoomInfoView/Direct.tsx | 2 +- app/views/RoomInfoView/Item.tsx | 2 +- app/views/RoomInfoView/Livechat.tsx | 2 +- app/views/RoomInfoView/index.tsx | 2 +- app/views/RoomMembersView/index.tsx | 2 +- app/views/RoomView/Banner.tsx | 2 +- app/views/RoomView/JoinCode.tsx | 2 +- app/views/RoomView/LeftButtons.tsx | 2 +- app/views/RoomView/List/NavBottomFAB.tsx | 2 +- app/views/RoomView/List/index.tsx | 2 +- app/views/RoomView/LoadMore/LoadMore.stories.js | 3 +-- app/views/RoomView/LoadMore/index.tsx | 3 +-- app/views/RoomView/ReactionPicker.tsx | 2 +- app/views/RoomView/Separator.tsx | 2 +- app/views/RoomView/UploadProgress.tsx | 2 +- app/views/RoomView/index.tsx | 4 +--- app/views/RoomView/services/getMoreMessages.ts | 2 +- app/views/RoomsListView/Header/Header.tsx | 2 +- app/views/RoomsListView/ListHeader/index.tsx | 3 +-- app/views/RoomsListView/ServerDropdown.tsx | 2 +- app/views/RoomsListView/index.tsx | 5 +---- app/views/ScreenLockConfigView.tsx | 3 +-- app/views/ScreenLockedView.tsx | 2 +- app/views/SearchMessagesView/index.tsx | 2 +- app/views/SecurityPrivacyView.tsx | 4 +--- app/views/SelectListView.tsx | 2 +- app/views/SelectedUsersView.tsx | 2 +- app/views/SetUsernameView.tsx | 2 +- app/views/SettingsView/index.tsx | 4 +--- app/views/ShareListView/Header/Header.ios.tsx | 2 +- app/views/ShareListView/Header/Header.tsx | 2 +- app/views/ShareListView/index.tsx | 2 +- app/views/ShareView/Header.tsx | 2 +- app/views/ShareView/Preview.tsx | 4 ++-- app/views/ShareView/Thumbs.tsx | 2 +- app/views/ShareView/index.tsx | 2 +- app/views/SidebarView/SidebarItem.tsx | 2 +- app/views/SidebarView/index.tsx | 2 +- app/views/Styles.js | 2 +- app/views/TeamChannelsView.tsx | 2 +- app/views/ThemeView.tsx | 3 +-- .../ThreadMessagesView/Dropdown/DropdownItem.tsx | 2 +- app/views/ThreadMessagesView/Dropdown/index.tsx | 2 +- app/views/ThreadMessagesView/Item.stories.js | 2 +- app/views/ThreadMessagesView/Item.tsx | 2 +- app/views/ThreadMessagesView/index.tsx | 2 +- app/views/UserNotificationPreferencesView/index.tsx | 2 +- app/views/UserPreferencesView/index.tsx | 2 +- app/views/WithoutServersView.tsx | 2 +- app/views/WorkspaceView/ServerAvatar.tsx | 2 +- app/views/WorkspaceView/index.tsx | 2 +- storybook/stories/Markdown.tsx | 2 +- storybook/stories/Message.js | 4 +--- storybook/stories/NewMarkdown.js | 2 +- storybook/stories/RoomItem.js | 3 +-- storybook/stories/UiKitMessage.js | 2 +- storybook/stories/UiKitModal.js | 2 +- 281 files changed, 290 insertions(+), 318 deletions(-) rename app/{ => lib}/constants/colors.ts (100%) rename app/{ => lib}/constants/constantDisplayMode.ts (100%) rename app/{constants/settings.ts => lib/constants/defaultSettings.ts} (99%) rename app/{ => lib}/constants/environment.ts (100%) create mode 100644 app/lib/constants/index.ts rename app/lib/{constants.ts => constants/keys.ts} (100%) rename app/{ => lib}/constants/links.ts (90%) rename app/{ => lib}/constants/localAuthentication.ts (100%) rename app/{ => lib}/constants/localPath.ts (100%) rename app/{ => lib}/constants/messageTypeLoad.ts (100%) rename app/{ => lib}/constants/messagesStatus.ts (50%) rename app/{ => lib}/constants/tablet.ts (100%) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index 79303a593..673e515a1 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -7,7 +7,7 @@ import Animated, { Easing, Extrapolate, interpolateNode, Value } from 'react-nat import { useSafeAreaInsets } from 'react-native-safe-area-context'; import ScrollBottomSheet from 'react-native-scroll-bottom-sheet'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useDimensions, useOrientation } from '../../dimensions'; import I18n from '../../i18n'; import { useTheme } from '../../theme'; diff --git a/app/containers/ActionSheet/Handle.tsx b/app/containers/ActionSheet/Handle.tsx index 1b2b6a62c..650d44ef5 100644 --- a/app/containers/ActionSheet/Handle.tsx +++ b/app/containers/ActionSheet/Handle.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; export const Handle = React.memo(() => { diff --git a/app/containers/ActionSheet/Item.tsx b/app/containers/ActionSheet/Item.tsx index 9c281f8c1..1a1627006 100644 --- a/app/containers/ActionSheet/Item.tsx +++ b/app/containers/ActionSheet/Item.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, View } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import { useTheme } from '../../theme'; import { Button } from './Button'; diff --git a/app/containers/ActivityIndicator.tsx b/app/containers/ActivityIndicator.tsx index 701926416..6e4f2db0a 100644 --- a/app/containers/ActivityIndicator.tsx +++ b/app/containers/ActivityIndicator.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { ActivityIndicator, ActivityIndicatorProps, StyleSheet } from 'react-native'; import { useTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; interface IActivityIndicator extends ActivityIndicatorProps { absolute?: boolean; diff --git a/app/containers/AppVersion.tsx b/app/containers/AppVersion.tsx index 217f46d44..bb1800f60 100644 --- a/app/containers/AppVersion.tsx +++ b/app/containers/AppVersion.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import sharedStyles from '../views/Styles'; import { getReadableVersion } from '../utils/deviceInfo'; import I18n from '../i18n'; diff --git a/app/containers/BackgroundContainer/index.tsx b/app/containers/BackgroundContainer/index.tsx index c9fc70d57..53636328c 100644 --- a/app/containers/BackgroundContainer/index.tsx +++ b/app/containers/BackgroundContainer/index.tsx @@ -3,7 +3,7 @@ import { ActivityIndicator, ImageBackground, StyleSheet, Text, View } from 'reac import { useTheme } from '../../theme'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; interface IBackgroundContainer { text?: string; diff --git a/app/containers/Button/index.tsx b/app/containers/Button/index.tsx index 8c99dccee..71d64e696 100644 --- a/app/containers/Button/index.tsx +++ b/app/containers/Button/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text } from 'react-native'; import Touchable from 'react-native-platform-touchable'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../../views/Styles'; import ActivityIndicator from '../ActivityIndicator'; diff --git a/app/containers/Check.tsx b/app/containers/Check.tsx index c51bc8b46..6a43cf9ad 100644 --- a/app/containers/Check.tsx +++ b/app/containers/Check.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet } from 'react-native'; import { CustomIcon } from '../lib/Icons'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { useTheme } from '../theme'; const styles = StyleSheet.create({ diff --git a/app/containers/EmojiPicker/TabBar.tsx b/app/containers/EmojiPicker/TabBar.tsx index 2517d6d15..240c56ecd 100644 --- a/app/containers/EmojiPicker/TabBar.tsx +++ b/app/containers/EmojiPicker/TabBar.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text, TouchableOpacity, View } from 'react-native'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; interface ITabBarProps { goToPage: Function; diff --git a/app/containers/EmojiPicker/index.tsx b/app/containers/EmojiPicker/index.tsx index 5c67b06df..5a2a71bb8 100644 --- a/app/containers/EmojiPicker/index.tsx +++ b/app/containers/EmojiPicker/index.tsx @@ -15,7 +15,7 @@ import { emojisByCategory } from '../../emojis'; import protectedFunction from '../../lib/methods/helpers/protectedFunction'; import shortnameToUnicode from '../../utils/shortnameToUnicode'; import log from '../../utils/log'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { IEmoji } from '../../definitions/IEmoji'; diff --git a/app/containers/FormContainer.tsx b/app/containers/FormContainer.tsx index 8c862b54d..3cdf0de7f 100644 --- a/app/containers/FormContainer.tsx +++ b/app/containers/FormContainer.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { ScrollView, ScrollViewProps, StyleSheet, View } from 'react-native'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import sharedStyles from '../views/Styles'; import scrollPersistTaps from '../utils/scrollPersistTaps'; import KeyboardView from '../presentation/KeyboardView'; diff --git a/app/containers/Header/index.tsx b/app/containers/Header/index.tsx index 17d888409..b9e2d1f43 100644 --- a/app/containers/Header/index.tsx +++ b/app/containers/Header/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { SafeAreaView } from 'react-native-safe-area-context'; import { StyleSheet, View } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { themedHeader } from '../../utils/navigation'; import { isIOS, isTablet } from '../../utils/deviceInfo'; import { useTheme } from '../../theme'; diff --git a/app/containers/HeaderButton/HeaderButtonItem.tsx b/app/containers/HeaderButton/HeaderButtonItem.tsx index 987975db2..20ea46082 100644 --- a/app/containers/HeaderButton/HeaderButtonItem.tsx +++ b/app/containers/HeaderButton/HeaderButtonItem.tsx @@ -4,7 +4,7 @@ import Touchable from 'react-native-platform-touchable'; import { CustomIcon } from '../../lib/Icons'; import { useTheme } from '../../theme'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../../views/Styles'; interface IHeaderButtonItem { diff --git a/app/containers/InAppNotification/NotifierComponent.tsx b/app/containers/InAppNotification/NotifierComponent.tsx index 5987c0c7a..6f886c010 100644 --- a/app/containers/InAppNotification/NotifierComponent.tsx +++ b/app/containers/InAppNotification/NotifierComponent.tsx @@ -8,7 +8,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'; import Avatar from '../Avatar'; import { CustomIcon } from '../../lib/Icons'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import { ROW_HEIGHT } from '../../presentation/RoomItem'; import { goRoom } from '../../utils/goRoom'; diff --git a/app/containers/List/ListHeader.tsx b/app/containers/List/ListHeader.tsx index 469d4cec6..301961268 100644 --- a/app/containers/List/ListHeader.tsx +++ b/app/containers/List/ListHeader.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import I18n from '../../i18n'; import { useTheme } from '../../theme'; import { PADDING_HORIZONTAL } from './constants'; diff --git a/app/containers/List/ListIcon.tsx b/app/containers/List/ListIcon.tsx index c134b1690..79e24ea66 100644 --- a/app/containers/List/ListIcon.tsx +++ b/app/containers/List/ListIcon.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import { useTheme } from '../../theme'; import { ICON_SIZE } from './constants'; diff --git a/app/containers/List/ListInfo.tsx b/app/containers/List/ListInfo.tsx index baac47ccc..1a8dc8910 100644 --- a/app/containers/List/ListInfo.tsx +++ b/app/containers/List/ListInfo.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import { PADDING_HORIZONTAL } from './constants'; import I18n from '../../i18n'; diff --git a/app/containers/List/ListItem.tsx b/app/containers/List/ListItem.tsx index c09266a41..0fef43c2a 100644 --- a/app/containers/List/ListItem.tsx +++ b/app/containers/List/ListItem.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { I18nManager, StyleSheet, Text, View } from 'react-native'; import Touch from '../../utils/touch'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../../views/Styles'; import { useTheme } from '../../theme'; import I18n from '../../i18n'; diff --git a/app/containers/List/ListSeparator.tsx b/app/containers/List/ListSeparator.tsx index f86dee196..d0e8d1cdd 100644 --- a/app/containers/List/ListSeparator.tsx +++ b/app/containers/List/ListSeparator.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleSheet, View, ViewStyle } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; const styles = StyleSheet.create({ diff --git a/app/containers/Loading.tsx b/app/containers/Loading.tsx index 69cd6565a..93ad43be2 100644 --- a/app/containers/Loading.tsx +++ b/app/containers/Loading.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Animated, Modal, StyleSheet, View } from 'react-native'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; const styles = StyleSheet.create({ container: { diff --git a/app/containers/LoginServices.tsx b/app/containers/LoginServices.tsx index f087922d1..7872a417d 100644 --- a/app/containers/LoginServices.tsx +++ b/app/containers/LoginServices.tsx @@ -7,7 +7,7 @@ import { StackNavigationProp } from '@react-navigation/stack'; import { withTheme } from '../theme'; import sharedStyles from '../views/Styles'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import Button from './Button'; import OrSeparator from './OrSeparator'; import Touch from '../utils/touch'; diff --git a/app/containers/MessageActions/Header.tsx b/app/containers/MessageActions/Header.tsx index 82cbee2cc..943b40c09 100644 --- a/app/containers/MessageActions/Header.tsx +++ b/app/containers/MessageActions/Header.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import { FlatList, StyleSheet, Text, View } from 'react-native'; import { useTheme } from '../../theme'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import shortnameToUnicode from '../../utils/shortnameToUnicode'; import CustomEmoji from '../EmojiPicker/CustomEmoji'; diff --git a/app/containers/MessageBox/CommandsPreview/Item.tsx b/app/containers/MessageBox/CommandsPreview/Item.tsx index e65ee70b7..a14a828aa 100644 --- a/app/containers/MessageBox/CommandsPreview/Item.tsx +++ b/app/containers/MessageBox/CommandsPreview/Item.tsx @@ -2,7 +2,7 @@ import FastImage from '@rocket.chat/react-native-fast-image'; import React, { useContext, useState } from 'react'; import { TouchableOpacity } from 'react-native'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { CustomIcon } from '../../../lib/Icons'; import { useTheme } from '../../../theme'; import ActivityIndicator from '../../ActivityIndicator'; diff --git a/app/containers/MessageBox/CommandsPreview/index.tsx b/app/containers/MessageBox/CommandsPreview/index.tsx index e5a94200a..924fc41e7 100644 --- a/app/containers/MessageBox/CommandsPreview/index.tsx +++ b/app/containers/MessageBox/CommandsPreview/index.tsx @@ -2,7 +2,7 @@ import { dequal } from 'dequal'; import React from 'react'; import { FlatList } from 'react-native'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { IPreviewItem } from '../../../definitions'; import { useTheme } from '../../../theme'; import styles from '../styles'; diff --git a/app/containers/MessageBox/EmojiKeyboard.tsx b/app/containers/MessageBox/EmojiKeyboard.tsx index c6e742170..e38660a9b 100644 --- a/app/containers/MessageBox/EmojiKeyboard.tsx +++ b/app/containers/MessageBox/EmojiKeyboard.tsx @@ -5,7 +5,7 @@ import { KeyboardRegistry } from 'react-native-ui-lib/keyboard'; import { store } from '../../lib/auxStore'; import EmojiPicker from '../EmojiPicker'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { IEmoji } from '../../definitions/IEmoji'; diff --git a/app/containers/MessageBox/Mentions/FixedMentionItem.tsx b/app/containers/MessageBox/Mentions/FixedMentionItem.tsx index 0b5693998..6846463b0 100644 --- a/app/containers/MessageBox/Mentions/FixedMentionItem.tsx +++ b/app/containers/MessageBox/Mentions/FixedMentionItem.tsx @@ -3,7 +3,7 @@ import { Text, TouchableOpacity } from 'react-native'; import styles from '../styles'; import I18n from '../../../i18n'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IMessageBoxFixedMentionItem { diff --git a/app/containers/MessageBox/Mentions/MentionHeaderList.tsx b/app/containers/MessageBox/Mentions/MentionHeaderList.tsx index 4be2dcdcd..d0a0284e4 100644 --- a/app/containers/MessageBox/Mentions/MentionHeaderList.tsx +++ b/app/containers/MessageBox/Mentions/MentionHeaderList.tsx @@ -1,14 +1,14 @@ import React, { useContext } from 'react'; import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import I18n from '../../../i18n'; import { CustomIcon } from '../../../lib/Icons'; import { useTheme } from '../../../theme'; import sharedStyles from '../../../views/Styles'; -import { MENTIONS_TRACKING_TYPE_CANNED } from '../constants'; import MessageboxContext from '../Context'; import styles from '../styles'; +import { MENTIONS_TRACKING_TYPE_CANNED } from '../constants'; interface IMentionHeaderList { trackingType: string; diff --git a/app/containers/MessageBox/Mentions/MentionItem.tsx b/app/containers/MessageBox/Mentions/MentionItem.tsx index 9daf4d47a..500ca8681 100644 --- a/app/containers/MessageBox/Mentions/MentionItem.tsx +++ b/app/containers/MessageBox/Mentions/MentionItem.tsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import { Text, TouchableOpacity } from 'react-native'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { IEmoji } from '../../../definitions/IEmoji'; import { useTheme } from '../../../theme'; import Avatar from '../../Avatar'; diff --git a/app/containers/MessageBox/Mentions/index.tsx b/app/containers/MessageBox/Mentions/index.tsx index c7bbd1539..80bee8979 100644 --- a/app/containers/MessageBox/Mentions/index.tsx +++ b/app/containers/MessageBox/Mentions/index.tsx @@ -5,7 +5,7 @@ import { dequal } from 'dequal'; import MentionHeaderList from './MentionHeaderList'; import styles from '../styles'; import MentionItem from './MentionItem'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IMessageBoxMentions { diff --git a/app/containers/MessageBox/RecordAudio.tsx b/app/containers/MessageBox/RecordAudio.tsx index 3071d6310..ac717ffb2 100644 --- a/app/containers/MessageBox/RecordAudio.tsx +++ b/app/containers/MessageBox/RecordAudio.tsx @@ -7,7 +7,7 @@ import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import styles from './styles'; import I18n from '../../i18n'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import { events, logEvent } from '../../utils/log'; diff --git a/app/containers/MessageBox/ReplyPreview.tsx b/app/containers/MessageBox/ReplyPreview.tsx index 24f426c17..27309fe93 100644 --- a/app/containers/MessageBox/ReplyPreview.tsx +++ b/app/containers/MessageBox/ReplyPreview.tsx @@ -6,7 +6,7 @@ import { connect } from 'react-redux'; import { MarkdownPreview } from '../markdown'; import { CustomIcon } from '../../lib/Icons'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { IMessage } from '../../definitions/IMessage'; import { useTheme } from '../../theme'; import { IApplicationState } from '../../definitions'; diff --git a/app/containers/MessageBox/buttons/BaseButton.tsx b/app/containers/MessageBox/buttons/BaseButton.tsx index be63c5934..6c9a36ae7 100644 --- a/app/containers/MessageBox/buttons/BaseButton.tsx +++ b/app/containers/MessageBox/buttons/BaseButton.tsx @@ -5,7 +5,7 @@ import styles from '../styles'; import i18n from '../../../i18n'; import { CustomIcon } from '../../../lib/Icons'; import { useTheme } from '../../../theme'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; interface IBaseButton { onPress(): void; diff --git a/app/containers/MessageBox/buttons/SendButton.tsx b/app/containers/MessageBox/buttons/SendButton.tsx index 2634307fd..e1dc19d43 100644 --- a/app/containers/MessageBox/buttons/SendButton.tsx +++ b/app/containers/MessageBox/buttons/SendButton.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import BaseButton from './BaseButton'; diff --git a/app/containers/MessageBox/index.tsx b/app/containers/MessageBox/index.tsx index a087949c9..463fc11d9 100644 --- a/app/containers/MessageBox/index.tsx +++ b/app/containers/MessageBox/index.tsx @@ -20,7 +20,7 @@ import RecordAudio from './RecordAudio'; import I18n from '../../i18n'; import ReplyPreview from './ReplyPreview'; import debounce from '../../utils/debounce'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; // @ts-ignore // eslint-disable-next-line import/extensions,import/no-unresolved import LeftButtons from './LeftButtons'; diff --git a/app/containers/OrSeparator.tsx b/app/containers/OrSeparator.tsx index 5be1ee883..408ed8d3c 100644 --- a/app/containers/OrSeparator.tsx +++ b/app/containers/OrSeparator.tsx @@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native'; import I18n from '../i18n'; import sharedStyles from '../views/Styles'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; const styles = StyleSheet.create({ container: { diff --git a/app/containers/Passcode/Base/Button.tsx b/app/containers/Passcode/Base/Button.tsx index 26ef8eca1..a60b1b23a 100644 --- a/app/containers/Passcode/Base/Button.tsx +++ b/app/containers/Passcode/Base/Button.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text } from 'react-native'; import styles from './styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import Touch from '../../../utils/touch'; import { CustomIcon } from '../../../lib/Icons'; import { useTheme } from '../../../theme'; diff --git a/app/containers/Passcode/Base/Dots.tsx b/app/containers/Passcode/Base/Dots.tsx index 25e41d6cd..378f78b0e 100644 --- a/app/containers/Passcode/Base/Dots.tsx +++ b/app/containers/Passcode/Base/Dots.tsx @@ -3,7 +3,7 @@ import { View } from 'react-native'; import range from 'lodash/range'; import styles from './styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; const SIZE_EMPTY = 12; diff --git a/app/containers/Passcode/Base/LockIcon.tsx b/app/containers/Passcode/Base/LockIcon.tsx index ea795e8eb..975124386 100644 --- a/app/containers/Passcode/Base/LockIcon.tsx +++ b/app/containers/Passcode/Base/LockIcon.tsx @@ -3,7 +3,7 @@ import { View } from 'react-native'; import { Row } from 'react-native-easy-grid'; import styles from './styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { CustomIcon } from '../../../lib/Icons'; import { useTheme } from '../../../theme'; diff --git a/app/containers/Passcode/Base/Locked.tsx b/app/containers/Passcode/Base/Locked.tsx index 6b9381fdf..a78be5ac4 100644 --- a/app/containers/Passcode/Base/Locked.tsx +++ b/app/containers/Passcode/Base/Locked.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { Grid } from 'react-native-easy-grid'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { resetAttempts } from '../../../utils/localAuthentication'; import { TYPE } from '../constants'; import { getDiff, getLockedUntil } from '../utils'; diff --git a/app/containers/Passcode/Base/Subtitle.tsx b/app/containers/Passcode/Base/Subtitle.tsx index 766cfcd7a..e98615d45 100644 --- a/app/containers/Passcode/Base/Subtitle.tsx +++ b/app/containers/Passcode/Base/Subtitle.tsx @@ -3,7 +3,7 @@ import { Text, View } from 'react-native'; import { Row } from 'react-native-easy-grid'; import styles from './styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IPasscodeSubtitle { diff --git a/app/containers/Passcode/Base/Title.tsx b/app/containers/Passcode/Base/Title.tsx index b66b861a9..8b8aa9578 100644 --- a/app/containers/Passcode/Base/Title.tsx +++ b/app/containers/Passcode/Base/Title.tsx @@ -3,7 +3,7 @@ import { Text, View } from 'react-native'; import { Row } from 'react-native-easy-grid'; import styles from './styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IPasscodeTitle { diff --git a/app/containers/Passcode/Base/index.tsx b/app/containers/Passcode/Base/index.tsx index 3a1bd3f73..940c5987f 100644 --- a/app/containers/Passcode/Base/index.tsx +++ b/app/containers/Passcode/Base/index.tsx @@ -9,8 +9,7 @@ import styles from './styles'; import Button from './Button'; import Dots from './Dots'; import { TYPE } from '../constants'; -import { themes } from '../../../constants/colors'; -import { PASSCODE_LENGTH } from '../../../constants/localAuthentication'; +import { PASSCODE_LENGTH, themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import LockIcon from './LockIcon'; import Title from './Title'; diff --git a/app/containers/Passcode/PasscodeEnter.tsx b/app/containers/Passcode/PasscodeEnter.tsx index a803bdeb4..992877c7d 100644 --- a/app/containers/Passcode/PasscodeEnter.tsx +++ b/app/containers/Passcode/PasscodeEnter.tsx @@ -7,7 +7,7 @@ import { sha256 } from 'js-sha256'; import Base, { IBase } from './Base'; import Locked from './Base/Locked'; import { TYPE } from './constants'; -import { ATTEMPTS_KEY, LOCKED_OUT_TIMER_KEY, MAX_ATTEMPTS, PASSCODE_KEY } from '../../constants/localAuthentication'; +import { ATTEMPTS_KEY, LOCKED_OUT_TIMER_KEY, MAX_ATTEMPTS, PASSCODE_KEY } from '../../lib/constants'; import { biometryAuth, resetAttempts } from '../../utils/localAuthentication'; import { getDiff, getLockedUntil } from './utils'; import { useUserPreferences } from '../../lib/methods/userPreferences'; diff --git a/app/containers/Passcode/utils.ts b/app/containers/Passcode/utils.ts index 4c6f21a7d..5bc3b8c3f 100644 --- a/app/containers/Passcode/utils.ts +++ b/app/containers/Passcode/utils.ts @@ -1,7 +1,7 @@ import AsyncStorage from '@react-native-community/async-storage'; import moment from 'moment'; -import { LOCKED_OUT_TIMER_KEY, TIME_TO_LOCK } from '../../constants/localAuthentication'; +import { LOCKED_OUT_TIMER_KEY, TIME_TO_LOCK } from '../../lib/constants'; export const getLockedUntil = async () => { const t = await AsyncStorage.getItem(LOCKED_OUT_TIMER_KEY); diff --git a/app/containers/ReactionsModal.tsx b/app/containers/ReactionsModal.tsx index 2bbd9fa4f..522448c0a 100644 --- a/app/containers/ReactionsModal.tsx +++ b/app/containers/ReactionsModal.tsx @@ -7,7 +7,7 @@ import Emoji from './message/Emoji'; import I18n from '../i18n'; import { CustomIcon } from '../lib/Icons'; import sharedStyles from '../views/Styles'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { useTheme, withTheme } from '../theme'; import { TGetCustomEmoji } from '../definitions/IEmoji'; import { TMessageModel, ILoggedUser } from '../definitions'; diff --git a/app/containers/RoomHeader/RoomHeader.tsx b/app/containers/RoomHeader/RoomHeader.tsx index 2ee96db45..f764c6421 100644 --- a/app/containers/RoomHeader/RoomHeader.tsx +++ b/app/containers/RoomHeader/RoomHeader.tsx @@ -3,7 +3,7 @@ import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import I18n from '../../i18n'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { MarkdownPreview } from '../markdown'; import RoomTypeIcon from '../RoomTypeIcon'; import { TUserStatus } from '../../definitions'; diff --git a/app/containers/RoomTypeIcon.tsx b/app/containers/RoomTypeIcon.tsx index ad9b63e1f..7a87ca9d5 100644 --- a/app/containers/RoomTypeIcon.tsx +++ b/app/containers/RoomTypeIcon.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, ViewStyle } from 'react-native'; import { CustomIcon } from '../lib/Icons'; -import { STATUS_COLORS, themes } from '../constants/colors'; +import { STATUS_COLORS, themes } from '../lib/constants'; import Status from './Status/Status'; import { withTheme } from '../theme'; import { TUserStatus } from '../definitions'; diff --git a/app/containers/SafeAreaView.tsx b/app/containers/SafeAreaView.tsx index 2ffae53ec..74a40ef05 100644 --- a/app/containers/SafeAreaView.tsx +++ b/app/containers/SafeAreaView.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, ViewProps } from 'react-native'; import { SafeAreaView as SafeAreaContext } from 'react-native-safe-area-context'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { useTheme } from '../theme'; const styles = StyleSheet.create({ diff --git a/app/containers/SearchBox.tsx b/app/containers/SearchBox.tsx index e19cd5343..2dbda29cd 100644 --- a/app/containers/SearchBox.tsx +++ b/app/containers/SearchBox.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text, TextInput as RNTextInput, TextInputProps, View } from 'react-native'; import Touchable from 'react-native-platform-touchable'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import I18n from '../i18n'; import { CustomIcon } from '../lib/Icons'; import TextInput from '../presentation/TextInput'; diff --git a/app/containers/SearchHeader.tsx b/app/containers/SearchHeader.tsx index 8d3c81416..589ef1d2b 100644 --- a/app/containers/SearchHeader.tsx +++ b/app/containers/SearchHeader.tsx @@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'; import I18n from '../i18n'; import { useTheme } from '../theme'; import sharedStyles from '../views/Styles'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import TextInput from '../presentation/TextInput'; import { isIOS, isTablet } from '../utils/deviceInfo'; import { useOrientation } from '../dimensions'; diff --git a/app/containers/Status/Status.tsx b/app/containers/Status/Status.tsx index 860f79601..b23b01dd9 100644 --- a/app/containers/Status/Status.tsx +++ b/app/containers/Status/Status.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleProp, TextStyle } from 'react-native'; import { CustomIcon } from '../../lib/Icons'; -import { STATUS_COLORS } from '../../constants/colors'; +import { STATUS_COLORS } from '../../lib/constants'; import { IStatus } from './definition'; const Status = React.memo(({ style, status = 'offline', size = 32, ...props }: Omit) => { diff --git a/app/containers/StatusBar.tsx b/app/containers/StatusBar.tsx index e54eb46e1..03349c92a 100644 --- a/app/containers/StatusBar.tsx +++ b/app/containers/StatusBar.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StatusBar as StatusBarRN } from 'react-native'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { useTheme } from '../theme'; const supportedStyles = { diff --git a/app/containers/TextInput.tsx b/app/containers/TextInput.tsx index 0224a6ef5..553206a08 100644 --- a/app/containers/TextInput.tsx +++ b/app/containers/TextInput.tsx @@ -4,7 +4,7 @@ import Touchable from 'react-native-platform-touchable'; import sharedStyles from '../views/Styles'; import TextInput from '../presentation/TextInput'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { CustomIcon } from '../lib/Icons'; import ActivityIndicator from './ActivityIndicator'; diff --git a/app/containers/ThreadDetails.tsx b/app/containers/ThreadDetails.tsx index 081397ef0..64a65d42a 100644 --- a/app/containers/ThreadDetails.tsx +++ b/app/containers/ThreadDetails.tsx @@ -3,7 +3,7 @@ import { StyleSheet, Text, View, ViewStyle } from 'react-native'; import Touchable from 'react-native-platform-touchable'; import { CustomIcon } from '../lib/Icons'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import sharedStyles from '../views/Styles'; import { useTheme } from '../theme'; import { TThreadModel } from '../definitions/IThread'; diff --git a/app/containers/Toast.tsx b/app/containers/Toast.tsx index ba1598f90..c19af1383 100644 --- a/app/containers/Toast.tsx +++ b/app/containers/Toast.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet } from 'react-native'; import EasyToast from 'react-native-easy-toast'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import sharedStyles from '../views/Styles'; import EventEmitter from '../utils/events'; import { withTheme } from '../theme'; diff --git a/app/containers/TwoFactor/index.tsx b/app/containers/TwoFactor/index.tsx index 200095b47..6509f57d3 100644 --- a/app/containers/TwoFactor/index.tsx +++ b/app/containers/TwoFactor/index.tsx @@ -10,7 +10,7 @@ import TextInput from '../TextInput'; import I18n from '../../i18n'; import EventEmitter from '../../utils/events'; import { useTheme } from '../../theme'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Button from '../Button'; import sharedStyles from '../../views/Styles'; import RocketChat from '../../lib/rocketchat'; diff --git a/app/containers/UIKit/DatePicker.tsx b/app/containers/UIKit/DatePicker.tsx index 69ebb1296..59fb576f1 100644 --- a/app/containers/UIKit/DatePicker.tsx +++ b/app/containers/UIKit/DatePicker.tsx @@ -7,7 +7,7 @@ import moment from 'moment'; import Button from '../Button'; import { textParser } from './utils'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../../views/Styles'; import { CustomIcon } from '../../lib/Icons'; import { isAndroid } from '../../utils/deviceInfo'; diff --git a/app/containers/UIKit/Input.tsx b/app/containers/UIKit/Input.tsx index b3492e447..70538701b 100644 --- a/app/containers/UIKit/Input.tsx +++ b/app/containers/UIKit/Input.tsx @@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native'; import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { IInput } from './interfaces'; const styles = StyleSheet.create({ diff --git a/app/containers/UIKit/MultiSelect/Chips.tsx b/app/containers/UIKit/MultiSelect/Chips.tsx index 7367bd497..49ebf1633 100644 --- a/app/containers/UIKit/MultiSelect/Chips.tsx +++ b/app/containers/UIKit/MultiSelect/Chips.tsx @@ -3,7 +3,7 @@ import { Text, View } from 'react-native'; import Touchable from 'react-native-platform-touchable'; import FastImage from '@rocket.chat/react-native-fast-image'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { textParser } from '../utils'; import { CustomIcon } from '../../../lib/Icons'; import styles from './styles'; diff --git a/app/containers/UIKit/MultiSelect/Input.tsx b/app/containers/UIKit/MultiSelect/Input.tsx index 00c5b20a1..3f270a0a7 100644 --- a/app/containers/UIKit/MultiSelect/Input.tsx +++ b/app/containers/UIKit/MultiSelect/Input.tsx @@ -3,7 +3,7 @@ import { Text, View } from 'react-native'; import Touchable from 'react-native-platform-touchable'; import { CustomIcon } from '../../../lib/Icons'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import ActivityIndicator from '../../ActivityIndicator'; import styles from './styles'; diff --git a/app/containers/UIKit/MultiSelect/Items.tsx b/app/containers/UIKit/MultiSelect/Items.tsx index 339139c1f..4e9265d24 100644 --- a/app/containers/UIKit/MultiSelect/Items.tsx +++ b/app/containers/UIKit/MultiSelect/Items.tsx @@ -6,7 +6,7 @@ import FastImage from '@rocket.chat/react-native-fast-image'; import Check from '../../Check'; import * as List from '../../List'; import { textParser } from '../utils'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import styles from './styles'; import { IItemData } from '.'; diff --git a/app/containers/UIKit/MultiSelect/index.tsx b/app/containers/UIKit/MultiSelect/index.tsx index 57ac91bf3..bb7c67e7e 100644 --- a/app/containers/UIKit/MultiSelect/index.tsx +++ b/app/containers/UIKit/MultiSelect/index.tsx @@ -15,7 +15,7 @@ import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; import Button from '../../Button'; import TextInput from '../../TextInput'; import { textParser } from '../utils'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import I18n from '../../../i18n'; import { isIOS } from '../../../utils/deviceInfo'; import { useTheme } from '../../../theme'; diff --git a/app/containers/UIKit/Overflow.tsx b/app/containers/UIKit/Overflow.tsx index 2d1f4c8b1..e3041370c 100644 --- a/app/containers/UIKit/Overflow.tsx +++ b/app/containers/UIKit/Overflow.tsx @@ -5,7 +5,7 @@ import Touchable from 'react-native-platform-touchable'; import { CustomIcon } from '../../lib/Icons'; import ActivityIndicator from '../ActivityIndicator'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import { BUTTON_HIT_SLOP } from '../message/utils'; import * as List from '../List'; diff --git a/app/containers/UIKit/Section.tsx b/app/containers/UIKit/Section.tsx index 5630b9660..ce549060d 100644 --- a/app/containers/UIKit/Section.tsx +++ b/app/containers/UIKit/Section.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { IAccessoryComponent, IFields, ISection } from './interfaces'; import { useTheme } from '../../theme'; diff --git a/app/containers/UIKit/Select.tsx b/app/containers/UIKit/Select.tsx index c2b213ac2..1e00ecc8b 100644 --- a/app/containers/UIKit/Select.tsx +++ b/app/containers/UIKit/Select.tsx @@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native'; import RNPickerSelect from 'react-native-picker-select'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import { textParser } from './utils'; import { isAndroid, isIOS } from '../../utils/deviceInfo'; diff --git a/app/containers/UIKit/index.tsx b/app/containers/UIKit/index.tsx index 8e7775a20..14ee93c25 100644 --- a/app/containers/UIKit/index.tsx +++ b/app/containers/UIKit/index.tsx @@ -7,7 +7,7 @@ import Markdown, { MarkdownPreview } from '../markdown'; import Button from '../Button'; import TextInput from '../TextInput'; import { textParser, useBlockContext } from './utils'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../../views/Styles'; import { Divider } from './Divider'; import { Section } from './Section'; diff --git a/app/containers/markdown/AtMention.tsx b/app/containers/markdown/AtMention.tsx index 707b7994d..2402ff087 100644 --- a/app/containers/markdown/AtMention.tsx +++ b/app/containers/markdown/AtMention.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleProp, Text, TextStyle } from 'react-native'; import { useTheme } from '../../theme'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; import { events, logEvent } from '../../utils/log'; import { IUserMention } from './interfaces'; diff --git a/app/containers/markdown/BlockQuote.tsx b/app/containers/markdown/BlockQuote.tsx index aa67c0e3d..5c3e1757a 100644 --- a/app/containers/markdown/BlockQuote.tsx +++ b/app/containers/markdown/BlockQuote.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { View } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; interface IBlockQuote { diff --git a/app/containers/markdown/Emoji.tsx b/app/containers/markdown/Emoji.tsx index f5672a599..061661388 100644 --- a/app/containers/markdown/Emoji.tsx +++ b/app/containers/markdown/Emoji.tsx @@ -3,7 +3,7 @@ import { Text } from 'react-native'; import shortnameToUnicode from '../../utils/shortnameToUnicode'; import CustomEmoji from '../EmojiPicker/CustomEmoji'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; interface IEmoji { diff --git a/app/containers/markdown/Hashtag.tsx b/app/containers/markdown/Hashtag.tsx index 482740ed1..6a3899960 100644 --- a/app/containers/markdown/Hashtag.tsx +++ b/app/containers/markdown/Hashtag.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleProp, Text, TextStyle } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import { IUserChannel } from './interfaces'; import styles from './styles'; diff --git a/app/containers/markdown/Link.tsx b/app/containers/markdown/Link.tsx index 0020d4828..a74443ab6 100644 --- a/app/containers/markdown/Link.tsx +++ b/app/containers/markdown/Link.tsx @@ -3,7 +3,7 @@ import { Text } from 'react-native'; import Clipboard from '@react-native-clipboard/clipboard'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { LISTENER } from '../Toast'; import EventEmitter from '../../utils/events'; import I18n from '../../i18n'; diff --git a/app/containers/markdown/ListItem.tsx b/app/containers/markdown/ListItem.tsx index f822bd87a..c109e69d3 100644 --- a/app/containers/markdown/ListItem.tsx +++ b/app/containers/markdown/ListItem.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; const style = StyleSheet.create({ container: { diff --git a/app/containers/markdown/Preview.tsx b/app/containers/markdown/Preview.tsx index fd7519643..65262da72 100644 --- a/app/containers/markdown/Preview.tsx +++ b/app/containers/markdown/Preview.tsx @@ -3,7 +3,7 @@ import { Text, TextStyle } from 'react-native'; import removeMarkdown from 'remove-markdown'; import shortnameToUnicode from '../../utils/shortnameToUnicode'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { formatText } from './formatText'; import { useTheme } from '../../theme'; import styles from './styles'; diff --git a/app/containers/markdown/Table.tsx b/app/containers/markdown/Table.tsx index 39ca2f3a9..7f1d07a51 100644 --- a/app/containers/markdown/Table.tsx +++ b/app/containers/markdown/Table.tsx @@ -5,7 +5,7 @@ import { CELL_WIDTH } from './TableCell'; import styles from './styles'; import Navigation from '../../lib/navigation/appNavigation'; import I18n from '../../i18n'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; interface ITable { children: React.ReactElement | null; diff --git a/app/containers/markdown/TableCell.tsx b/app/containers/markdown/TableCell.tsx index bc8c89b84..dba820b96 100644 --- a/app/containers/markdown/TableCell.tsx +++ b/app/containers/markdown/TableCell.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, View, ViewStyle } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; interface ITableCell { diff --git a/app/containers/markdown/TableRow.tsx b/app/containers/markdown/TableRow.tsx index 7874c48d7..bd001fb6e 100644 --- a/app/containers/markdown/TableRow.tsx +++ b/app/containers/markdown/TableRow.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { View, ViewStyle } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; interface ITableRow { diff --git a/app/containers/markdown/index.tsx b/app/containers/markdown/index.tsx index e4c942d1e..f1360c810 100644 --- a/app/containers/markdown/index.tsx +++ b/app/containers/markdown/index.tsx @@ -5,7 +5,6 @@ import Renderer from 'commonmark-react-renderer'; import { MarkdownAST } from '@rocket.chat/message-parser'; import I18n from '../../i18n'; -import { themes } from '../../constants/colors'; import MarkdownLink from './Link'; import MarkdownList from './List'; import MarkdownListItem from './ListItem'; @@ -24,6 +23,7 @@ import { formatText } from './formatText'; import { IUserMention, IUserChannel, TOnLinkPress } from './interfaces'; import { TGetCustomEmoji } from '../../definitions/IEmoji'; import { formatHyperlink } from './formatHyperlink'; +import { themes } from '../../lib/constants'; export { default as MarkdownPreview } from './Preview'; diff --git a/app/containers/markdown/new/Code.tsx b/app/containers/markdown/new/Code.tsx index f3e060125..f8303a2b6 100644 --- a/app/containers/markdown/new/Code.tsx +++ b/app/containers/markdown/new/Code.tsx @@ -3,7 +3,7 @@ import { Text } from 'react-native'; import { Code as CodeProps } from '@rocket.chat/message-parser'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import CodeLine from './CodeLine'; diff --git a/app/containers/markdown/new/Emoji.tsx b/app/containers/markdown/new/Emoji.tsx index 2d03ab08a..9d101c4ff 100644 --- a/app/containers/markdown/new/Emoji.tsx +++ b/app/containers/markdown/new/Emoji.tsx @@ -3,7 +3,7 @@ import { Text } from 'react-native'; import { Emoji as EmojiProps } from '@rocket.chat/message-parser'; import shortnameToUnicode from '../../../utils/shortnameToUnicode'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import styles from '../styles'; import CustomEmoji from '../../EmojiPicker/CustomEmoji'; diff --git a/app/containers/markdown/new/Heading.tsx b/app/containers/markdown/new/Heading.tsx index a949f52c8..56db6a7fd 100644 --- a/app/containers/markdown/new/Heading.tsx +++ b/app/containers/markdown/new/Heading.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text } from 'react-native'; import { Heading as HeadingProps } from '@rocket.chat/message-parser'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import styles from '../styles'; import { useTheme } from '../../../theme'; diff --git a/app/containers/markdown/new/Image.tsx b/app/containers/markdown/new/Image.tsx index 94bcfac91..00d1b3e9d 100644 --- a/app/containers/markdown/new/Image.tsx +++ b/app/containers/markdown/new/Image.tsx @@ -5,7 +5,7 @@ import * as Progress from 'react-native-progress'; import FastImage from '@rocket.chat/react-native-fast-image'; import { useTheme } from '../../../theme'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import styles from '../../message/styles'; interface IImageProps { diff --git a/app/containers/markdown/new/InlineCode.tsx b/app/containers/markdown/new/InlineCode.tsx index 123eca379..c66996db5 100644 --- a/app/containers/markdown/new/InlineCode.tsx +++ b/app/containers/markdown/new/InlineCode.tsx @@ -3,7 +3,7 @@ import { Text } from 'react-native'; import { InlineCode as InlineCodeProps } from '@rocket.chat/message-parser'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IInlineCodeProps { diff --git a/app/containers/markdown/new/Link.tsx b/app/containers/markdown/new/Link.tsx index 3a8a03b67..096d9e7f0 100644 --- a/app/containers/markdown/new/Link.tsx +++ b/app/containers/markdown/new/Link.tsx @@ -9,7 +9,7 @@ import { LISTENER } from '../../Toast'; import { useTheme } from '../../../theme'; import openLink from '../../../utils/openLink'; import EventEmitter from '../../../utils/events'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import Strike from './Strike'; import Italic from './Italic'; import Bold from './Bold'; diff --git a/app/containers/markdown/new/OrderedList.tsx b/app/containers/markdown/new/OrderedList.tsx index d4226c54e..b71c086ff 100644 --- a/app/containers/markdown/new/OrderedList.tsx +++ b/app/containers/markdown/new/OrderedList.tsx @@ -4,7 +4,7 @@ import { OrderedList as OrderedListProps } from '@rocket.chat/message-parser'; import Inline from './Inline'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IOrderedListProps { diff --git a/app/containers/markdown/new/Paragraph.tsx b/app/containers/markdown/new/Paragraph.tsx index 93cb81e44..c58d4be5d 100644 --- a/app/containers/markdown/new/Paragraph.tsx +++ b/app/containers/markdown/new/Paragraph.tsx @@ -5,7 +5,7 @@ import { Paragraph as ParagraphProps } from '@rocket.chat/message-parser'; import Inline from './Inline'; import styles from '../styles'; import { useTheme } from '../../../theme'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; interface IParagraphProps { value: ParagraphProps['value']; diff --git a/app/containers/markdown/new/Plain.tsx b/app/containers/markdown/new/Plain.tsx index 784bef63a..c63c725b9 100644 --- a/app/containers/markdown/new/Plain.tsx +++ b/app/containers/markdown/new/Plain.tsx @@ -4,7 +4,7 @@ import { Plain as PlainProps } from '@rocket.chat/message-parser'; import styles from '../styles'; import { useTheme } from '../../../theme'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; interface IPlainProps { value: PlainProps['value']; diff --git a/app/containers/markdown/new/Quote.tsx b/app/containers/markdown/new/Quote.tsx index d3005845a..8578097b3 100644 --- a/app/containers/markdown/new/Quote.tsx +++ b/app/containers/markdown/new/Quote.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { Quote as QuoteProps } from '@rocket.chat/message-parser'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import styles from '../styles'; import Paragraph from './Paragraph'; diff --git a/app/containers/markdown/new/TaskList.tsx b/app/containers/markdown/new/TaskList.tsx index 4359ba42c..8104ba5e3 100644 --- a/app/containers/markdown/new/TaskList.tsx +++ b/app/containers/markdown/new/TaskList.tsx @@ -4,7 +4,7 @@ import { Tasks as TasksProps } from '@rocket.chat/message-parser'; import Inline from './Inline'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface ITasksProps { diff --git a/app/containers/markdown/new/UnorderedList.tsx b/app/containers/markdown/new/UnorderedList.tsx index 09e16cdc7..8df46edf7 100644 --- a/app/containers/markdown/new/UnorderedList.tsx +++ b/app/containers/markdown/new/UnorderedList.tsx @@ -4,7 +4,7 @@ import { View, Text } from 'react-native'; import Inline from './Inline'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; interface IUnorderedListProps { diff --git a/app/containers/message/Attachments.tsx b/app/containers/message/Attachments.tsx index 3989c212a..397620e1d 100644 --- a/app/containers/message/Attachments.tsx +++ b/app/containers/message/Attachments.tsx @@ -14,7 +14,7 @@ import { useTheme } from '../../theme'; import { IAttachment } from '../../definitions'; import CollapsibleQuote from './Components/CollapsibleQuote'; import openLink from '../../utils/openLink'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; export type TElement = { type: string; diff --git a/app/containers/message/Audio.tsx b/app/containers/message/Audio.tsx index 30d564098..c1a129459 100644 --- a/app/containers/message/Audio.tsx +++ b/app/containers/message/Audio.tsx @@ -11,7 +11,7 @@ import Touchable from './Touchable'; import Markdown from '../markdown'; import { CustomIcon } from '../../lib/Icons'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { isAndroid, isIOS } from '../../utils/deviceInfo'; import MessageContext from './Context'; import ActivityIndicator from '../ActivityIndicator'; diff --git a/app/containers/message/Broadcast.tsx b/app/containers/message/Broadcast.tsx index 267b62822..6a0efdaf8 100644 --- a/app/containers/message/Broadcast.tsx +++ b/app/containers/message/Broadcast.tsx @@ -6,7 +6,7 @@ import { CustomIcon } from '../../lib/Icons'; import styles from './styles'; import { BUTTON_HIT_SLOP } from './utils'; import I18n from '../../i18n'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { IMessageBroadcast } from './interfaces'; import { useTheme } from '../../theme'; diff --git a/app/containers/message/CallButton.tsx b/app/containers/message/CallButton.tsx index 7df5a7d12..240e56189 100644 --- a/app/containers/message/CallButton.tsx +++ b/app/containers/message/CallButton.tsx @@ -6,7 +6,7 @@ import { BUTTON_HIT_SLOP } from './utils'; import styles from './styles'; import I18n from '../../i18n'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { IMessageCallButton } from './interfaces'; import { useTheme } from '../../theme'; diff --git a/app/containers/message/Components/CollapsibleQuote/index.tsx b/app/containers/message/Components/CollapsibleQuote/index.tsx index 484e690ba..2def3340c 100644 --- a/app/containers/message/Components/CollapsibleQuote/index.tsx +++ b/app/containers/message/Components/CollapsibleQuote/index.tsx @@ -3,7 +3,7 @@ import { dequal } from 'dequal'; import React, { useContext, useState } from 'react'; import { StyleSheet, Text, View } from 'react-native'; -import { themes } from '../../../../constants/colors'; +import { themes } from '../../../../lib/constants'; import { IAttachment } from '../../../../definitions/IAttachment'; import { TGetCustomEmoji } from '../../../../definitions/IEmoji'; import { CustomIcon } from '../../../../lib/Icons'; diff --git a/app/containers/message/Content.tsx b/app/containers/message/Content.tsx index db664d2cc..243e80948 100644 --- a/app/containers/message/Content.tsx +++ b/app/containers/message/Content.tsx @@ -7,12 +7,11 @@ import styles from './styles'; import Markdown, { MarkdownPreview } from '../markdown'; import User from './User'; import { SYSTEM_MESSAGE_TYPES_WITH_AUTHOR_NAME, getInfoMessage } from './utils'; -import { themes } from '../../constants/colors'; import MessageContext from './Context'; import Encrypted from './Encrypted'; -import { E2E_MESSAGE_TYPE } from '../../lib/constants'; import { IMessageContent } from './interfaces'; import { useTheme } from '../../theme'; +import { E2E_MESSAGE_TYPE, themes } from '../../lib/constants'; const Content = React.memo( (props: IMessageContent) => { diff --git a/app/containers/message/Discussion.tsx b/app/containers/message/Discussion.tsx index 6ef8f13b6..1e6e9ed55 100644 --- a/app/containers/message/Discussion.tsx +++ b/app/containers/message/Discussion.tsx @@ -7,7 +7,7 @@ import styles from './styles'; import I18n from '../../i18n'; import { CustomIcon } from '../../lib/Icons'; import { DISCUSSION } from './constants'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { formatDateThreads } from '../../utils/room'; import { IMessage } from '../../definitions'; diff --git a/app/containers/message/Encrypted.tsx b/app/containers/message/Encrypted.tsx index 5896f4b36..d86add6ec 100644 --- a/app/containers/message/Encrypted.tsx +++ b/app/containers/message/Encrypted.tsx @@ -1,13 +1,12 @@ import React, { useContext } from 'react'; import Touchable from './Touchable'; -import { E2E_MESSAGE_TYPE } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; import { BUTTON_HIT_SLOP } from './utils'; import MessageContext from './Context'; import styles from './styles'; import { useTheme } from '../../theme'; +import { E2E_MESSAGE_TYPE, themes } from '../../lib/constants'; const Encrypted = React.memo(({ type }: { type: string }) => { const { theme } = useTheme(); diff --git a/app/containers/message/Image.tsx b/app/containers/message/Image.tsx index f7f123f97..45dc331eb 100644 --- a/app/containers/message/Image.tsx +++ b/app/containers/message/Image.tsx @@ -8,7 +8,7 @@ import * as Progress from 'react-native-progress'; import Touchable from './Touchable'; import Markdown from '../markdown'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { TGetCustomEmoji } from '../../definitions/IEmoji'; import { IAttachment } from '../../definitions'; diff --git a/app/containers/message/Message.tsx b/app/containers/message/Message.tsx index 5c22293b0..f99b11a41 100644 --- a/app/containers/message/Message.tsx +++ b/app/containers/message/Message.tsx @@ -17,7 +17,7 @@ import Discussion from './Discussion'; import Content from './Content'; import ReadReceipt from './ReadReceipt'; import CallButton from './CallButton'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { IMessage, IMessageInner, IMessageTouchable } from './interfaces'; import { useTheme } from '../../theme'; diff --git a/app/containers/message/MessageError.tsx b/app/containers/message/MessageError.tsx index d72c8c911..d5f4fef98 100644 --- a/app/containers/message/MessageError.tsx +++ b/app/containers/message/MessageError.tsx @@ -4,7 +4,7 @@ import Touchable from './Touchable'; import { CustomIcon } from '../../lib/Icons'; import styles from './styles'; import { BUTTON_HIT_SLOP } from './utils'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { useTheme } from '../../theme'; diff --git a/app/containers/message/Reactions.tsx b/app/containers/message/Reactions.tsx index 346b24002..0e013fc4b 100644 --- a/app/containers/message/Reactions.tsx +++ b/app/containers/message/Reactions.tsx @@ -6,7 +6,7 @@ import { CustomIcon } from '../../lib/Icons'; import styles from './styles'; import Emoji from './Emoji'; import { BUTTON_HIT_SLOP } from './utils'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import MessageContext from './Context'; import { TGetCustomEmoji } from '../../definitions/IEmoji'; diff --git a/app/containers/message/ReadReceipt.tsx b/app/containers/message/ReadReceipt.tsx index 4a68acf16..5556b781f 100644 --- a/app/containers/message/ReadReceipt.tsx +++ b/app/containers/message/ReadReceipt.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import styles from './styles'; import { useTheme } from '../../theme'; diff --git a/app/containers/message/RepliedThread.tsx b/app/containers/message/RepliedThread.tsx index fc0f92577..b681264dc 100644 --- a/app/containers/message/RepliedThread.tsx +++ b/app/containers/message/RepliedThread.tsx @@ -3,7 +3,7 @@ import { View } from 'react-native'; import { CustomIcon } from '../../lib/Icons'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import I18n from '../../i18n'; import { MarkdownPreview } from '../markdown'; import { IMessageRepliedThread } from './interfaces'; diff --git a/app/containers/message/Reply.tsx b/app/containers/message/Reply.tsx index a080988bf..f3d45f51e 100644 --- a/app/containers/message/Reply.tsx +++ b/app/containers/message/Reply.tsx @@ -8,7 +8,7 @@ import Touchable from './Touchable'; import Markdown from '../markdown'; import openLink from '../../utils/openLink'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { fileDownloadAndPreview } from '../../utils/fileDownload'; import { IAttachment } from '../../definitions/IAttachment'; diff --git a/app/containers/message/Thread.tsx b/app/containers/message/Thread.tsx index 4bfed49ac..00d9e5ab5 100644 --- a/app/containers/message/Thread.tsx +++ b/app/containers/message/Thread.tsx @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import { Text, View } from 'react-native'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import ThreadDetails from '../ThreadDetails'; import I18n from '../../i18n'; diff --git a/app/containers/message/Urls.tsx b/app/containers/message/Urls.tsx index 65da7cd52..91846e1bb 100644 --- a/app/containers/message/Urls.tsx +++ b/app/containers/message/Urls.tsx @@ -7,7 +7,7 @@ import { dequal } from 'dequal'; import Touchable from './Touchable'; import openLink from '../../utils/openLink'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme, withTheme } from '../../theme'; import { LISTENER } from '../Toast'; import EventEmitter from '../../utils/events'; diff --git a/app/containers/message/User.tsx b/app/containers/message/User.tsx index ed42c225c..e8a7ee7de 100644 --- a/app/containers/message/User.tsx +++ b/app/containers/message/User.tsx @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import moment from 'moment'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import MessageError from './MessageError'; import sharedStyles from '../../views/Styles'; diff --git a/app/containers/message/Video.tsx b/app/containers/message/Video.tsx index b651b5dcd..69870c7eb 100644 --- a/app/containers/message/Video.tsx +++ b/app/containers/message/Video.tsx @@ -6,7 +6,7 @@ import Touchable from './Touchable'; import Markdown from '../markdown'; import { isIOS } from '../../utils/deviceInfo'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import MessageContext from './Context'; import { fileDownload } from '../../utils/fileDownload'; import EventEmitter from '../../utils/events'; diff --git a/app/containers/message/index.tsx b/app/containers/message/index.tsx index 804794196..37ed92cac 100644 --- a/app/containers/message/index.tsx +++ b/app/containers/message/index.tsx @@ -6,13 +6,12 @@ import Message from './Message'; import MessageContext from './Context'; import debounce from '../../utils/debounce'; import { SYSTEM_MESSAGES, getMessageTranslation } from './utils'; -import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../../lib/constants'; -import messagesStatus from '../../constants/messagesStatus'; import { useTheme, withTheme } from '../../theme'; import openLink from '../../utils/openLink'; import { TGetCustomEmoji } from '../../definitions/IEmoji'; import { IAttachment, TAnyMessageModel } from '../../definitions'; import { IRoomInfoParam } from '../../views/SearchMessagesView'; +import { E2E_MESSAGE_TYPE, E2E_STATUS, messagesStatus } from '../../lib/constants'; interface IMessageContainerProps { item: TAnyMessageModel; diff --git a/app/definitions/IMessage.ts b/app/definitions/IMessage.ts index 7a6cf234d..ff32100c0 100644 --- a/app/definitions/IMessage.ts +++ b/app/definitions/IMessage.ts @@ -1,7 +1,7 @@ import Model from '@nozbe/watermelondb/Model'; import { MarkdownAST } from '@rocket.chat/message-parser'; -import { MessageTypeLoad } from '../constants/messageTypeLoad'; +import { MessageTypeLoad } from '../lib/constants'; import { IAttachment } from './IAttachment'; import { IReaction } from './IReaction'; import { TThreadMessageModel } from './IThreadMessage'; diff --git a/app/definitions/IPreferences.ts b/app/definitions/IPreferences.ts index d444dd7e4..c71253081 100644 --- a/app/definitions/IPreferences.ts +++ b/app/definitions/IPreferences.ts @@ -1,4 +1,4 @@ -import { SortBy, DisplayMode } from '../constants/constantDisplayMode'; +import { SortBy, DisplayMode } from '../lib/constants'; export interface IPreferences { sortBy: SortBy; diff --git a/app/ee/omnichannel/containers/OmnichannelStatus.tsx b/app/ee/omnichannel/containers/OmnichannelStatus.tsx index 33d99efd5..3df4e544d 100644 --- a/app/ee/omnichannel/containers/OmnichannelStatus.tsx +++ b/app/ee/omnichannel/containers/OmnichannelStatus.tsx @@ -3,7 +3,7 @@ import { Switch, View } from 'react-native'; import * as List from '../../../containers/List'; import styles from '../../../views/RoomsListView/styles'; -import { SWITCH_TRACK_COLOR, themes } from '../../../constants/colors'; +import { SWITCH_TRACK_COLOR, themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import UnreadBadge from '../../../presentation/UnreadBadge'; import RocketChat from '../../../lib/rocketchat'; diff --git a/app/ee/omnichannel/views/QueueListView.tsx b/app/ee/omnichannel/views/QueueListView.tsx index bb898e13f..bb5c0a316 100644 --- a/app/ee/omnichannel/views/QueueListView.tsx +++ b/app/ee/omnichannel/views/QueueListView.tsx @@ -7,13 +7,11 @@ import { dequal } from 'dequal'; import I18n from '../../../i18n'; import RoomItem, { ROW_HEIGHT } from '../../../presentation/RoomItem'; -import { MAX_SIDEBAR_WIDTH } from '../../../constants/tablet'; import { isIOS, isTablet } from '../../../utils/deviceInfo'; import { getUserSelector } from '../../../selectors/login'; import { withTheme } from '../../../theme'; import { withDimensions } from '../../../dimensions'; import SafeAreaView from '../../../containers/SafeAreaView'; -import { themes } from '../../../constants/colors'; import StatusBar from '../../../containers/StatusBar'; import { goRoom } from '../../../utils/goRoom'; import * as HeaderButton from '../../../containers/HeaderButton'; @@ -21,7 +19,7 @@ import RocketChat from '../../../lib/rocketchat'; import { events, logEvent } from '../../../utils/log'; import { getInquiryQueueSelector } from '../selectors/inquiry'; import { IOmnichannelRoom, IApplicationState } from '../../../definitions'; -import { DisplayMode } from '../../../constants/constantDisplayMode'; +import { DisplayMode, MAX_SIDEBAR_WIDTH, themes } from '../../../lib/constants'; import { ChatsStackParamList } from '../../../stacks/types'; import { MasterDetailInsideStackParamList } from '../../../stacks/MasterDetailStack/types'; import { TSettingsValues } from '../../../reducers/settings'; diff --git a/app/index.tsx b/app/index.tsx index 218098447..6d3dd9b2e 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -17,7 +17,6 @@ import { toggleAnalyticsEventsReport, toggleCrashErrorsReport } from './utils/lo import { ThemeContext, TSupportedThemes } from './theme'; import { DimensionsContext } from './dimensions'; import RocketChat from './lib/rocketchat'; -import { MIN_WIDTH_MASTER_DETAIL_LAYOUT } from './constants/tablet'; import { isTablet } from './utils/deviceInfo'; import { KEY_COMMAND } from './commands'; import AppContainer from './AppContainer'; @@ -28,11 +27,10 @@ import Toast from './containers/Toast'; import InAppNotification from './containers/InAppNotification'; import { ActionSheetProvider } from './containers/ActionSheet'; import debounce from './utils/debounce'; -import { isFDroidBuild } from './constants/environment'; +import { isFDroidBuild, MIN_WIDTH_MASTER_DETAIL_LAYOUT, colors, themes } from './lib/constants'; import { IThemePreference } from './definitions/ITheme'; import { ICommand } from './definitions/ICommand'; import { initStore } from './lib/auxStore'; -import { colors, themes } from './constants/colors'; RNScreens.enableScreens(); initStore(store); diff --git a/app/constants/colors.ts b/app/lib/constants/colors.ts similarity index 100% rename from app/constants/colors.ts rename to app/lib/constants/colors.ts diff --git a/app/constants/constantDisplayMode.ts b/app/lib/constants/constantDisplayMode.ts similarity index 100% rename from app/constants/constantDisplayMode.ts rename to app/lib/constants/constantDisplayMode.ts diff --git a/app/constants/settings.ts b/app/lib/constants/defaultSettings.ts similarity index 99% rename from app/constants/settings.ts rename to app/lib/constants/defaultSettings.ts index b84779427..8b1eed2a6 100644 --- a/app/constants/settings.ts +++ b/app/lib/constants/defaultSettings.ts @@ -1,4 +1,4 @@ -export default { +export const defaultSettings = { Accounts_AllowEmailChange: { type: 'valueAsBoolean' }, diff --git a/app/constants/environment.ts b/app/lib/constants/environment.ts similarity index 100% rename from app/constants/environment.ts rename to app/lib/constants/environment.ts diff --git a/app/lib/constants/index.ts b/app/lib/constants/index.ts new file mode 100644 index 000000000..7d273a803 --- /dev/null +++ b/app/lib/constants/index.ts @@ -0,0 +1,11 @@ +export * from './colors'; +export * from './constantDisplayMode'; +export * from './environment'; +export * from './keys'; +export * from './links'; +export * from './localAuthentication'; +export * from './localPath'; +export * from './messagesStatus'; +export * from './messageTypeLoad'; +export * from './defaultSettings'; +export * from './tablet'; diff --git a/app/lib/constants.ts b/app/lib/constants/keys.ts similarity index 100% rename from app/lib/constants.ts rename to app/lib/constants/keys.ts diff --git a/app/constants/links.ts b/app/lib/constants/links.ts similarity index 90% rename from app/constants/links.ts rename to app/lib/constants/links.ts index af93b5e39..cedad74a1 100644 --- a/app/constants/links.ts +++ b/app/lib/constants/links.ts @@ -1,4 +1,4 @@ -import { getBundleId, isIOS } from '../utils/deviceInfo'; +import { getBundleId, isIOS } from '../../utils/deviceInfo'; const APP_STORE_ID = '1148741252'; diff --git a/app/constants/localAuthentication.ts b/app/lib/constants/localAuthentication.ts similarity index 100% rename from app/constants/localAuthentication.ts rename to app/lib/constants/localAuthentication.ts diff --git a/app/constants/localPath.ts b/app/lib/constants/localPath.ts similarity index 100% rename from app/constants/localPath.ts rename to app/lib/constants/localPath.ts diff --git a/app/constants/messageTypeLoad.ts b/app/lib/constants/messageTypeLoad.ts similarity index 100% rename from app/constants/messageTypeLoad.ts rename to app/lib/constants/messageTypeLoad.ts diff --git a/app/constants/messagesStatus.ts b/app/lib/constants/messagesStatus.ts similarity index 50% rename from app/constants/messagesStatus.ts rename to app/lib/constants/messagesStatus.ts index 4f945f939..366d8b0e8 100644 --- a/app/constants/messagesStatus.ts +++ b/app/lib/constants/messagesStatus.ts @@ -1,4 +1,4 @@ -export default { +export const messagesStatus = { SENT: 0, TEMP: 1, ERROR: 2 diff --git a/app/constants/tablet.ts b/app/lib/constants/tablet.ts similarity index 100% rename from app/constants/tablet.ts rename to app/lib/constants/tablet.ts diff --git a/app/lib/database/index.ts b/app/lib/database/index.ts index d85e826d6..0f3f5e7f5 100644 --- a/app/lib/database/index.ts +++ b/app/lib/database/index.ts @@ -4,7 +4,7 @@ import logger from '@nozbe/watermelondb/utils/common/logger'; import { isIOS } from '../../utils/deviceInfo'; import appGroup from '../../utils/appGroup'; -import { isOfficial } from '../../constants/environment'; +import { isOfficial } from '../constants'; import Subscription from './model/Subscription'; import Room from './model/Room'; import Message from './model/Message'; diff --git a/app/lib/encryption/encryption.ts b/app/lib/encryption/encryption.ts index d4231c4dc..ff1727185 100644 --- a/app/lib/encryption/encryption.ts +++ b/app/lib/encryption/encryption.ts @@ -10,6 +10,9 @@ import protectedFunction from '../methods/helpers/protectedFunction'; import Deferred from '../../utils/deferred'; import log from '../../utils/log'; import { store } from '../auxStore'; +import { joinVectorData, randomPassword, splitVectorData, toString, utf8ToBuffer } from './utils'; +import { EncryptionRoom } from './index'; +import { IMessage, ISubscription, TMessageModel, TSubscriptionModel, TThreadMessageModel, TThreadModel } from '../../definitions'; import { E2E_BANNER_TYPE, E2E_MESSAGE_TYPE, @@ -18,9 +21,6 @@ import { E2E_RANDOM_PASSWORD_KEY, E2E_STATUS } from '../constants'; -import { joinVectorData, randomPassword, splitVectorData, toString, utf8ToBuffer } from './utils'; -import { EncryptionRoom } from './index'; -import { IMessage, ISubscription, TMessageModel, TSubscriptionModel, TThreadMessageModel, TThreadModel } from '../../definitions'; class Encryption { ready: boolean; diff --git a/app/lib/encryption/room.ts b/app/lib/encryption/room.ts index 45907aa98..f2ed355d9 100644 --- a/app/lib/encryption/room.ts +++ b/app/lib/encryption/room.ts @@ -9,7 +9,6 @@ import Deferred from '../../utils/deferred'; import debounce from '../../utils/debounce'; import database from '../database'; import log from '../../utils/log'; -import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../constants'; import { b64ToBuffer, bufferToB64, @@ -22,6 +21,7 @@ import { } from './utils'; import { Encryption } from './index'; import { IUser } from '../../definitions/IUser'; +import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../constants'; export default class EncryptionRoom { ready: boolean; diff --git a/app/lib/methods/helpers/buildMessage.ts b/app/lib/methods/helpers/buildMessage.ts index 96ee8ccbe..96bc28f17 100644 --- a/app/lib/methods/helpers/buildMessage.ts +++ b/app/lib/methods/helpers/buildMessage.ts @@ -1,5 +1,5 @@ import { ILastMessage, IMessage, IThreadResult } from '../../../definitions'; -import messagesStatus from '../../../constants/messagesStatus'; +import { messagesStatus } from '../../constants'; import normalizeMessage from './normalizeMessage'; export default (message: Partial | IThreadResult | ILastMessage): IMessage | IThreadResult | null => { diff --git a/app/lib/methods/loadMessagesForRoom.ts b/app/lib/methods/loadMessagesForRoom.ts index e74e754c3..234434b77 100644 --- a/app/lib/methods/loadMessagesForRoom.ts +++ b/app/lib/methods/loadMessagesForRoom.ts @@ -1,6 +1,6 @@ import moment from 'moment'; -import { MessageTypeLoad } from '../../constants/messageTypeLoad'; +import { MessageTypeLoad } from '../constants'; import { IMessage, TMessageModel } from '../../definitions'; import log from '../../utils/log'; import { getMessageById } from '../database/services/Message'; diff --git a/app/lib/methods/loadNextMessages.ts b/app/lib/methods/loadNextMessages.ts index 6331c8774..a7a729ad3 100644 --- a/app/lib/methods/loadNextMessages.ts +++ b/app/lib/methods/loadNextMessages.ts @@ -4,7 +4,7 @@ import orderBy from 'lodash/orderBy'; import log from '../../utils/log'; import { getMessageById } from '../database/services/Message'; -import { MessageTypeLoad } from '../../constants/messageTypeLoad'; +import { MessageTypeLoad } from '../constants'; import updateMessages from './updateMessages'; import { TMessageModel } from '../../definitions'; import sdk from '../rocketchat/services/sdk'; diff --git a/app/lib/methods/loadSurroundingMessages.ts b/app/lib/methods/loadSurroundingMessages.ts index a125edd90..81ea1523d 100644 --- a/app/lib/methods/loadSurroundingMessages.ts +++ b/app/lib/methods/loadSurroundingMessages.ts @@ -4,7 +4,7 @@ import orderBy from 'lodash/orderBy'; import log from '../../utils/log'; import { getMessageById } from '../database/services/Message'; -import { MessageTypeLoad } from '../../constants/messageTypeLoad'; +import { MessageTypeLoad } from '../constants'; import sdk from '../rocketchat/services/sdk'; import { IMessage } from '../../definitions'; import updateMessages from './updateMessages'; diff --git a/app/lib/methods/sendMessage.ts b/app/lib/methods/sendMessage.ts index aaf03ea8d..95a3537d0 100644 --- a/app/lib/methods/sendMessage.ts +++ b/app/lib/methods/sendMessage.ts @@ -1,14 +1,13 @@ import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord'; import { Model } from '@nozbe/watermelondb'; -import messagesStatus from '../../constants/messagesStatus'; import database from '../database'; import log from '../../utils/log'; import random from '../../utils/random'; import { Encryption } from '../encryption'; -import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../constants'; import { E2EType, IMessage, IUser, TMessageModel } from '../../definitions'; import sdk from '../rocketchat/services/sdk'; +import { E2E_MESSAGE_TYPE, E2E_STATUS, messagesStatus } from '../constants'; const changeMessageStatus = async (id: string, status: number, tmid?: string, message?: IMessage) => { const db = database.active; diff --git a/app/lib/methods/subscriptions/rooms.ts b/app/lib/methods/subscriptions/rooms.ts index fa7f3a734..4a41475cb 100644 --- a/app/lib/methods/subscriptions/rooms.ts +++ b/app/lib/methods/subscriptions/rooms.ts @@ -17,7 +17,6 @@ import { removedRoom } from '../../../actions/room'; import { setUser } from '../../../actions/login'; import { INAPP_NOTIFICATION_EMITTER } from '../../../containers/InAppNotification'; import { Encryption } from '../../encryption'; -import { E2E_MESSAGE_TYPE } from '../../constants'; import updateMessages from '../updateMessages'; import { IMessage, @@ -33,6 +32,7 @@ import sdk from '../../rocketchat/services/sdk'; import { IDDPMessage } from '../../../definitions/IDDPMessage'; import { getSubscriptionByRoomId } from '../../database/services/Subscription'; import { getMessageById } from '../../database/services/Message'; +import { E2E_MESSAGE_TYPE } from '../../constants'; const removeListener = (listener: { stop: () => void }) => listener.stop(); diff --git a/app/lib/methods/updateMessages.ts b/app/lib/methods/updateMessages.ts index b95fbd125..6acbdce14 100644 --- a/app/lib/methods/updateMessages.ts +++ b/app/lib/methods/updateMessages.ts @@ -1,7 +1,7 @@ import { Q } from '@nozbe/watermelondb'; import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord'; -import { MESSAGE_TYPE_ANY_LOAD } from '../../constants/messageTypeLoad'; +import { MESSAGE_TYPE_ANY_LOAD } from '../constants'; import { IMessage, TMessageModel, TSubscriptionModel, TThreadMessageModel, TThreadModel } from '../../definitions'; import database from '../database'; import { getSubscriptionByRoomId } from '../database/services/Subscription'; diff --git a/app/lib/rocketchat/methods/getSettings.ts b/app/lib/rocketchat/methods/getSettings.ts index cae346c15..01b549690 100644 --- a/app/lib/rocketchat/methods/getSettings.ts +++ b/app/lib/rocketchat/methods/getSettings.ts @@ -2,8 +2,7 @@ import { Q } from '@nozbe/watermelondb'; import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord'; import { addSettings, clearSettings } from '../../../actions/settings'; -import { DEFAULT_AUTO_LOCK } from '../../../constants/localAuthentication'; -import settings from '../../../constants/settings'; +import { DEFAULT_AUTO_LOCK, defaultSettings } from '../../constants'; import { IPreparedSettings, ISettingsIcon } from '../../../definitions'; import fetch from '../../../utils/fetch'; import log from '../../../utils/log'; @@ -144,7 +143,7 @@ type IData = ISettingsIcon | IPreparedSettings; export async function getSettings(): Promise { try { const db = database.active; - const settingsParams = Object.keys(settings).filter(key => !loginSettings.includes(key)); + const settingsParams = Object.keys(defaultSettings).filter(key => !loginSettings.includes(key)); // RC 0.60.0 const result = await fetch( `${sdk.current.client.host}/api/v1/settings.public?query={"_id":{"$in":${JSON.stringify(settingsParams)}}}&count=${ diff --git a/app/lib/rocketchat/methods/helpers.ts b/app/lib/rocketchat/methods/helpers.ts index a0fcd64cf..4a06e50ef 100644 --- a/app/lib/rocketchat/methods/helpers.ts +++ b/app/lib/rocketchat/methods/helpers.ts @@ -3,10 +3,9 @@ import AsyncStorage from '@react-native-community/async-storage'; import log from '../../../utils/log'; import { store as reduxStore } from '../../auxStore'; -import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY } from '../../constants'; -import defaultSettings from '../../../constants/settings'; import database from '../../database'; import subscribeRoomsTmp from '../../methods/subscriptions/rooms'; +import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY, defaultSettings } from '../../constants'; export function isGroupChat(room): boolean { return ((room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2)) ?? false; diff --git a/app/lib/rocketchat/methods/logout.ts b/app/lib/rocketchat/methods/logout.ts index 4fe5e05d6..d070002a3 100644 --- a/app/lib/rocketchat/methods/logout.ts +++ b/app/lib/rocketchat/methods/logout.ts @@ -9,10 +9,10 @@ import database, { getDatabase } from '../../database'; import RocketChat from '..'; import { useSsl } from '../../../utils/url'; import log from '../../../utils/log'; -import { E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../../constants'; import UserPreferences from '../../methods/userPreferences'; import { ICertificate, IRocketChat } from '../../../definitions'; import sdk from '../services/sdk'; +import { E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../../constants'; function removeServerKeys({ server, userId }: { server: string; userId?: string | null }) { UserPreferences.removeItem(`${RocketChat.TOKEN_KEY}-${server}`); diff --git a/app/lib/rocketchat/services/connect.ts b/app/lib/rocketchat/services/connect.ts index 636f45a68..f8f2c1f64 100644 --- a/app/lib/rocketchat/services/connect.ts +++ b/app/lib/rocketchat/services/connect.ts @@ -22,8 +22,7 @@ import { connectRequest, connectSuccess, disconnect as disconnectAction } from ' import { updatePermission } from '../../../actions/permissions'; import EventEmitter from '../../../utils/events'; import { updateSettings } from '../../../actions/settings'; -import defaultSettings from '../../../constants/settings'; -import { MIN_ROCKETCHAT_VERSION } from '../../constants'; +import { defaultSettings, MIN_ROCKETCHAT_VERSION } from '../../constants'; import { compareServerVersion } from '../../methods/helpers/compareServerVersion'; interface IServices { diff --git a/app/notifications/push/index.ts b/app/notifications/push/index.ts index 749517642..e9ac11fba 100644 --- a/app/notifications/push/index.ts +++ b/app/notifications/push/index.ts @@ -2,7 +2,7 @@ import EJSON from 'ejson'; import { store } from '../../lib/auxStore'; import { deepLinkingOpen } from '../../actions/deepLinking'; -import { isFDroidBuild } from '../../constants/environment'; +import { isFDroidBuild } from '../../lib/constants'; import PushNotification from './push'; import { INotification, SubscriptionType } from '../../definitions'; diff --git a/app/presentation/DirectoryItem/index.tsx b/app/presentation/DirectoryItem/index.tsx index 234c1e312..1cdbe63e8 100644 --- a/app/presentation/DirectoryItem/index.tsx +++ b/app/presentation/DirectoryItem/index.tsx @@ -5,7 +5,7 @@ import Touch from '../../utils/touch'; import Avatar from '../../containers/Avatar'; import RoomTypeIcon from '../../containers/RoomTypeIcon'; import styles, { ROW_HEIGHT } from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; export { ROW_HEIGHT }; diff --git a/app/presentation/ImageViewer/ImageViewer.android.tsx b/app/presentation/ImageViewer/ImageViewer.android.tsx index cbb79c7fe..158e76938 100644 --- a/app/presentation/ImageViewer/ImageViewer.android.tsx +++ b/app/presentation/ImageViewer/ImageViewer.android.tsx @@ -4,7 +4,7 @@ import { PanGestureHandler, PinchGestureHandler, State } from 'react-native-gest import Animated, { EasingNode } from 'react-native-reanimated'; import { ImageComponent } from './ImageComponent'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; const styles = StyleSheet.create({ flex: { diff --git a/app/presentation/ImageViewer/ImageViewer.tsx b/app/presentation/ImageViewer/ImageViewer.tsx index 117bf95dd..74a58ea79 100644 --- a/app/presentation/ImageViewer/ImageViewer.tsx +++ b/app/presentation/ImageViewer/ImageViewer.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { ScrollView, StyleSheet } from 'react-native'; import { ImageComponent } from './ImageComponent'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; const styles = StyleSheet.create({ scrollContent: { diff --git a/app/presentation/RoomItem/Actions.tsx b/app/presentation/RoomItem/Actions.tsx index 2b53955a9..21c7fe9c3 100644 --- a/app/presentation/RoomItem/Actions.tsx +++ b/app/presentation/RoomItem/Actions.tsx @@ -4,8 +4,7 @@ import { RectButton } from 'react-native-gesture-handler'; import { isRTL } from '../../i18n'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; -import { DisplayMode } from '../../constants/constantDisplayMode'; +import { DisplayMode, themes } from '../../lib/constants'; import styles, { ACTION_WIDTH, LONG_SWIPE, ROW_HEIGHT_CONDENSED } from './styles'; interface ILeftActions { diff --git a/app/presentation/RoomItem/IconOrAvatar.js b/app/presentation/RoomItem/IconOrAvatar.js index 29343477a..567c4a6e1 100644 --- a/app/presentation/RoomItem/IconOrAvatar.js +++ b/app/presentation/RoomItem/IconOrAvatar.js @@ -3,7 +3,7 @@ import { View } from 'react-native'; import PropTypes from 'prop-types'; import Avatar from '../../containers/Avatar'; -import { DisplayMode } from '../../constants/constantDisplayMode'; +import { DisplayMode } from '../../lib/constants'; import TypeIcon from './TypeIcon'; import styles from './styles'; diff --git a/app/presentation/RoomItem/LastMessage.tsx b/app/presentation/RoomItem/LastMessage.tsx index b2715bb42..beab95ea5 100644 --- a/app/presentation/RoomItem/LastMessage.tsx +++ b/app/presentation/RoomItem/LastMessage.tsx @@ -4,8 +4,7 @@ import { dequal } from 'dequal'; import I18n from '../../i18n'; import styles from './styles'; import { MarkdownPreview } from '../../containers/markdown'; -import { themes } from '../../constants/colors'; -import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../../lib/constants'; +import { E2E_MESSAGE_TYPE, E2E_STATUS, themes } from '../../lib/constants'; interface ILastMessage { theme: string; diff --git a/app/presentation/RoomItem/RoomItem.tsx b/app/presentation/RoomItem/RoomItem.tsx index 497cf91a2..b4e8d133e 100644 --- a/app/presentation/RoomItem/RoomItem.tsx +++ b/app/presentation/RoomItem/RoomItem.tsx @@ -11,7 +11,7 @@ import UpdatedAt from './UpdatedAt'; import Touchable from './Touchable'; import Tag from './Tag'; import I18n from '../../i18n'; -import { DisplayMode } from '../../constants/constantDisplayMode'; +import { DisplayMode } from '../../lib/constants'; import { TUserStatus } from '../../definitions'; interface IRoomItem { diff --git a/app/presentation/RoomItem/Tag.tsx b/app/presentation/RoomItem/Tag.tsx index 084e03e88..0b07b8060 100644 --- a/app/presentation/RoomItem/Tag.tsx +++ b/app/presentation/RoomItem/Tag.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, View } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import styles from './styles'; diff --git a/app/presentation/RoomItem/Title.tsx b/app/presentation/RoomItem/Title.tsx index 93f74bf21..d4f8253c5 100644 --- a/app/presentation/RoomItem/Title.tsx +++ b/app/presentation/RoomItem/Title.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text } from 'react-native'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; interface ITitle { name: string; diff --git a/app/presentation/RoomItem/Touchable.tsx b/app/presentation/RoomItem/Touchable.tsx index b40436aaa..03fbc31d1 100644 --- a/app/presentation/RoomItem/Touchable.tsx +++ b/app/presentation/RoomItem/Touchable.tsx @@ -5,7 +5,7 @@ import { LongPressGestureHandler, PanGestureHandler, State } from 'react-native- import Touch from '../../utils/touch'; import { ACTION_WIDTH, LONG_SWIPE, SMALL_SWIPE } from './styles'; import { isRTL } from '../../i18n'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { LeftActions, RightActions } from './Actions'; interface ITouchableProps { diff --git a/app/presentation/RoomItem/UpdatedAt.tsx b/app/presentation/RoomItem/UpdatedAt.tsx index eed4416aa..d5a0babad 100644 --- a/app/presentation/RoomItem/UpdatedAt.tsx +++ b/app/presentation/RoomItem/UpdatedAt.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text } from 'react-native'; import styles from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { capitalize } from '../../utils/room'; interface IUpdatedAt { diff --git a/app/presentation/RoomItem/Wrapper.tsx b/app/presentation/RoomItem/Wrapper.tsx index d0d2b150e..222934c25 100644 --- a/app/presentation/RoomItem/Wrapper.tsx +++ b/app/presentation/RoomItem/Wrapper.tsx @@ -1,8 +1,7 @@ import React from 'react'; import { View } from 'react-native'; -import { themes } from '../../constants/colors'; -import { DisplayMode } from '../../constants/constantDisplayMode'; +import { DisplayMode, themes } from '../../lib/constants'; import IconOrAvatar from './IconOrAvatar'; import styles from './styles'; diff --git a/app/presentation/ServerItem/index.tsx b/app/presentation/ServerItem/index.tsx index f46223a45..a70aaf858 100644 --- a/app/presentation/ServerItem/index.tsx +++ b/app/presentation/ServerItem/index.tsx @@ -5,7 +5,7 @@ import FastImage from '@rocket.chat/react-native-fast-image'; import Check from '../../containers/Check'; import styles, { ROW_HEIGHT } from './styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { isIOS } from '../../utils/deviceInfo'; import { withTheme } from '../../theme'; diff --git a/app/presentation/TextInput.tsx b/app/presentation/TextInput.tsx index 6f1ac31b3..27996244d 100644 --- a/app/presentation/TextInput.tsx +++ b/app/presentation/TextInput.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { I18nManager, StyleProp, StyleSheet, TextInput, TextStyle } from 'react-native'; import { IRCTextInputProps } from '../containers/TextInput'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; const styles = StyleSheet.create({ input: { diff --git a/app/presentation/UnreadBadge/getUnreadStyle.test.js b/app/presentation/UnreadBadge/getUnreadStyle.test.js index 8ac3ea047..03dd850af 100644 --- a/app/presentation/UnreadBadge/getUnreadStyle.test.js +++ b/app/presentation/UnreadBadge/getUnreadStyle.test.js @@ -1,5 +1,5 @@ /* eslint-disable no-undef */ -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { getUnreadStyle } from './getUnreadStyle'; const testsForTheme = theme => { diff --git a/app/presentation/UnreadBadge/getUnreadStyle.ts b/app/presentation/UnreadBadge/getUnreadStyle.ts index 94e7acca4..442979fb0 100644 --- a/app/presentation/UnreadBadge/getUnreadStyle.ts +++ b/app/presentation/UnreadBadge/getUnreadStyle.ts @@ -1,4 +1,4 @@ -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; export const getUnreadStyle = ({ unread, userMentions, groupMentions, theme, tunread, tunreadUser, tunreadGroup }: any) => { if ((!unread || unread <= 0) && !tunread?.length) { diff --git a/app/presentation/UserItem.tsx b/app/presentation/UserItem.tsx index b2e9d0b16..0c2a456c0 100644 --- a/app/presentation/UserItem.tsx +++ b/app/presentation/UserItem.tsx @@ -5,7 +5,7 @@ import { Pressable, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-n import Avatar from '../containers/Avatar'; import { CustomIcon } from '../lib/Icons'; import sharedStyles from '../views/Styles'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { isIOS } from '../utils/deviceInfo'; const styles = StyleSheet.create({ diff --git a/app/reducers/settings.ts b/app/reducers/settings.ts index 090cf73a2..a8ea96a9d 100644 --- a/app/reducers/settings.ts +++ b/app/reducers/settings.ts @@ -1,8 +1,8 @@ import { IActionSettings } from '../actions/settings'; import { SETTINGS } from '../actions/actionsTypes'; -import settings from '../constants/settings'; +import { defaultSettings } from '../lib/constants'; -export type TSupportedSettings = keyof typeof settings; +export type TSupportedSettings = keyof typeof defaultSettings; export type TSettingsValues = string | number | boolean | string[]; export type TSettingsState = { diff --git a/app/reducers/sortPreferences.test.ts b/app/reducers/sortPreferences.test.ts index 5de29933d..5ef0ff94d 100644 --- a/app/reducers/sortPreferences.test.ts +++ b/app/reducers/sortPreferences.test.ts @@ -2,7 +2,7 @@ import { IPreferences } from '../definitions'; import { setAllPreferences, setPreference } from '../actions/sortPreferences'; import { mockedStore } from './mockedStore'; import { initialState } from './sortPreferences'; -import { DisplayMode, SortBy } from '../constants/constantDisplayMode'; +import { DisplayMode, SortBy } from '../lib/constants'; describe('test sortPreferences reducer', () => { it('should return initial state', () => { diff --git a/app/reducers/sortPreferences.ts b/app/reducers/sortPreferences.ts index 2083e8f7a..32771a3e4 100644 --- a/app/reducers/sortPreferences.ts +++ b/app/reducers/sortPreferences.ts @@ -1,5 +1,5 @@ import { SORT_PREFERENCES } from '../actions/actionsTypes'; -import { DisplayMode, SortBy } from '../constants/constantDisplayMode'; +import { DisplayMode, SortBy } from '../lib/constants'; import { IPreferences, TApplicationActions } from '../definitions'; export const initialState: IPreferences = { diff --git a/app/sagas/encryption.js b/app/sagas/encryption.js index 4ab7e83d7..d363c5054 100644 --- a/app/sagas/encryption.js +++ b/app/sagas/encryption.js @@ -5,7 +5,6 @@ import { ENCRYPTION } from '../actions/actionsTypes'; import { encryptionSet } from '../actions/encryption'; import { Encryption } from '../lib/encryption'; import Navigation from '../lib/navigation/appNavigation'; -import { E2E_BANNER_TYPE, E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../lib/constants'; import database from '../lib/database'; import RocketChat from '../lib/rocketchat'; import UserPreferences from '../lib/methods/userPreferences'; @@ -13,6 +12,7 @@ import { getUserSelector } from '../selectors/login'; import { showErrorAlert } from '../utils/info'; import I18n from '../i18n'; import log from '../utils/log'; +import { E2E_BANNER_TYPE, E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../lib/constants'; const getServer = state => state.share.server.server || state.server.server; const getE2eEnable = state => state.settings.E2E_Enable; diff --git a/app/sagas/init.js b/app/sagas/init.js index 87196a7f0..78f2de3d7 100644 --- a/app/sagas/init.js +++ b/app/sagas/init.js @@ -1,7 +1,7 @@ import { put, takeLatest } from 'redux-saga/effects'; import RNBootSplash from 'react-native-bootsplash'; -import { BIOMETRY_ENABLED_KEY } from '../constants/localAuthentication'; +import { BIOMETRY_ENABLED_KEY } from '../lib/constants'; import UserPreferences from '../lib/methods/userPreferences'; import { selectServerRequest } from '../actions/server'; import { setAllPreferences } from '../actions/sortPreferences'; diff --git a/app/share.tsx b/app/share.tsx index 8a4ca1f1d..94075a830 100644 --- a/app/share.tsx +++ b/app/share.tsx @@ -28,7 +28,7 @@ import AuthLoadingView from './views/AuthLoadingView'; import { DimensionsContext } from './dimensions'; import debounce from './utils/debounce'; import { ShareInsideStackParamList, ShareOutsideStackParamList, ShareAppStackParamList } from './definitions/navigationTypes'; -import { colors } from './constants/colors'; +import { colors } from './lib/constants'; initStore(store); diff --git a/app/stacks/InsideStack.tsx b/app/stacks/InsideStack.tsx index ec3ae318e..6c6c0249a 100644 --- a/app/stacks/InsideStack.tsx +++ b/app/stacks/InsideStack.tsx @@ -30,7 +30,7 @@ import MarkdownTableView from '../views/MarkdownTableView'; import ReadReceiptsView from '../views/ReadReceiptView'; import CannedResponsesListView from '../views/CannedResponsesListView'; import CannedResponseDetail from '../views/CannedResponseDetail'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; // Profile Stack import ProfileView from '../views/ProfileView'; import UserPreferencesView from '../views/UserPreferencesView'; diff --git a/app/stacks/MasterDetailStack/ModalContainer.tsx b/app/stacks/MasterDetailStack/ModalContainer.tsx index 376ff8769..c6120e335 100644 --- a/app/stacks/MasterDetailStack/ModalContainer.tsx +++ b/app/stacks/MasterDetailStack/ModalContainer.tsx @@ -4,7 +4,7 @@ import { StackNavigationProp } from '@react-navigation/stack'; import { NavigationContainerProps } from '@react-navigation/core'; import sharedStyles from '../../views/Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; interface IModalContainer extends NavigationContainerProps { navigation: StackNavigationProp; diff --git a/app/theme.tsx b/app/theme.tsx index e06c4ec00..c9b4326de 100644 --- a/app/theme.tsx +++ b/app/theme.tsx @@ -1,9 +1,9 @@ import hoistNonReactStatics from 'hoist-non-react-statics'; import React from 'react'; -import { colors } from './constants/colors'; import { IThemePreference } from './definitions/ITheme'; import { TNavigationOptions } from './definitions/navigationTypes'; +import { colors } from './lib/constants'; export type TSupportedThemes = keyof typeof colors; export type TColors = typeof colors[TSupportedThemes]; diff --git a/app/utils/fileDownload/index.ts b/app/utils/fileDownload/index.ts index 279d3b3a5..c087875de 100644 --- a/app/utils/fileDownload/index.ts +++ b/app/utils/fileDownload/index.ts @@ -4,7 +4,7 @@ import FileViewer from 'react-native-file-viewer'; import EventEmitter from '../events'; import { LISTENER } from '../../containers/Toast'; import I18n from '../../i18n'; -import { DOCUMENTS_PATH, DOWNLOAD_PATH } from '../../constants/localPath'; +import { DOCUMENTS_PATH, DOWNLOAD_PATH } from '../../lib/constants'; import { IAttachment } from '../../definitions/IAttachment'; export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`; diff --git a/app/utils/localAuthentication.ts b/app/utils/localAuthentication.ts index aac73a456..35704374d 100644 --- a/app/utils/localAuthentication.ts +++ b/app/utils/localAuthentication.ts @@ -15,7 +15,7 @@ import { LOCAL_AUTHENTICATE_EMITTER, LOCKED_OUT_TIMER_KEY, PASSCODE_KEY -} from '../constants/localAuthentication'; +} from '../lib/constants'; import I18n from '../i18n'; import { setLocalAuthenticated } from '../actions/login'; import { TServerModel } from '../definitions/IServer'; diff --git a/app/utils/log/index.ts b/app/utils/log/index.ts index bebbf147a..88ccc8d36 100644 --- a/app/utils/log/index.ts +++ b/app/utils/log/index.ts @@ -1,6 +1,6 @@ import firebaseAnalytics from '@react-native-firebase/analytics'; -import { isFDroidBuild } from '../../constants/environment'; +import { isFDroidBuild } from '../../lib/constants'; import events from './events'; const analytics = firebaseAnalytics || ''; diff --git a/app/utils/navigation/index.ts b/app/utils/navigation/index.ts index 9314e88e8..21ede13a1 100644 --- a/app/utils/navigation/index.ts +++ b/app/utils/navigation/index.ts @@ -1,7 +1,7 @@ import { StyleSheet } from 'react-native'; import { DarkTheme, DefaultTheme } from '@react-navigation/native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; export * from './animations'; diff --git a/app/utils/openLink.ts b/app/utils/openLink.ts index b0305f775..d90a06932 100644 --- a/app/utils/openLink.ts +++ b/app/utils/openLink.ts @@ -2,8 +2,8 @@ import { Linking } from 'react-native'; import * as WebBrowser from 'expo-web-browser'; import parse from 'url-parse'; +import { themes } from '../lib/constants'; import UserPreferences from '../lib/methods/userPreferences'; -import { themes } from '../constants/colors'; export const DEFAULT_BROWSER_KEY = 'DEFAULT_BROWSER_KEY'; diff --git a/app/utils/review.ts b/app/utils/review.ts index bbbb498be..8b58e8593 100644 --- a/app/utils/review.ts +++ b/app/utils/review.ts @@ -2,8 +2,7 @@ import { Alert, Linking } from 'react-native'; import AsyncStorage from '@react-native-community/async-storage'; import I18n from '../i18n'; -import { STORE_REVIEW_LINK } from '../constants/links'; -import { isFDroidBuild } from '../constants/environment'; +import { isFDroidBuild, STORE_REVIEW_LINK } from '../lib/constants'; import { showErrorAlert } from './info'; import { isIOS } from './deviceInfo'; import { events, logEvent } from './log'; diff --git a/app/utils/room.ts b/app/utils/room.ts index bf6cd0804..c79681855 100644 --- a/app/utils/room.ts +++ b/app/utils/room.ts @@ -1,6 +1,6 @@ import moment from 'moment'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import I18n from '../i18n'; import { IAttachment } from '../definitions/IAttachment'; import { SubscriptionType, TSubscriptionModel } from '../definitions/ISubscription'; diff --git a/app/utils/theme.ts b/app/utils/theme.ts index 1678a156e..3f8779135 100644 --- a/app/utils/theme.ts +++ b/app/utils/theme.ts @@ -3,11 +3,10 @@ import changeNavigationBarColor from 'react-native-navigation-bar-color'; import setRootViewColor from 'rn-root-view'; import { IThemePreference, TThemeMode } from '../definitions/ITheme'; -import { themes } from '../constants/colors'; -import { isAndroid } from './deviceInfo'; +import { themes, THEME_PREFERENCES_KEY } from '../lib/constants'; import UserPreferences from '../lib/methods/userPreferences'; -import { THEME_PREFERENCES_KEY } from '../lib/constants'; import { TSupportedThemes } from '../theme'; +import { isAndroid } from './deviceInfo'; let themeListener: { remove: () => void } | null; diff --git a/app/utils/touch.tsx b/app/utils/touch.tsx index 3573c87c5..00cdbd4ad 100644 --- a/app/utils/touch.tsx +++ b/app/utils/touch.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { RectButton, RectButtonProps } from 'react-native-gesture-handler'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; interface ITouchProps extends RectButtonProps { children: React.ReactNode; diff --git a/app/views/AddExistingChannelView.tsx b/app/views/AddExistingChannelView.tsx index 69af6b57b..ad08a368c 100644 --- a/app/views/AddExistingChannelView.tsx +++ b/app/views/AddExistingChannelView.tsx @@ -13,7 +13,7 @@ import log, { events, logEvent } from '../utils/log'; import SearchBox from '../containers/SearchBox'; import * as HeaderButton from '../containers/HeaderButton'; import StatusBar from '../containers/StatusBar'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { withTheme } from '../theme'; import SafeAreaView from '../containers/SafeAreaView'; import Loading from '../containers/Loading'; diff --git a/app/views/AttachmentView.tsx b/app/views/AttachmentView.tsx index b93106a40..a7a3a23d3 100644 --- a/app/views/AttachmentView.tsx +++ b/app/views/AttachmentView.tsx @@ -15,7 +15,7 @@ import EventEmitter from '../utils/events'; import I18n from '../i18n'; import { withTheme } from '../theme'; import { ImageViewer } from '../presentation/ImageViewer'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import RCActivityIndicator from '../containers/ActivityIndicator'; import * as HeaderButton from '../containers/HeaderButton'; import { isAndroid } from '../utils/deviceInfo'; diff --git a/app/views/AuthLoadingView.tsx b/app/views/AuthLoadingView.tsx index ef6e7b943..9ffb4fdf6 100644 --- a/app/views/AuthLoadingView.tsx +++ b/app/views/AuthLoadingView.tsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import I18n from '../i18n'; import StatusBar from '../containers/StatusBar'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import sharedStyles from './Styles'; const styles = StyleSheet.create({ diff --git a/app/views/AutoTranslateView/index.tsx b/app/views/AutoTranslateView/index.tsx index 07acef800..6c59a7fbd 100644 --- a/app/views/AutoTranslateView/index.tsx +++ b/app/views/AutoTranslateView/index.tsx @@ -7,7 +7,7 @@ import RocketChat from '../../lib/rocketchat'; import I18n from '../../i18n'; import StatusBar from '../../containers/StatusBar'; import * as List from '../../containers/List'; -import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; +import { SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import SafeAreaView from '../../containers/SafeAreaView'; import { events, logEvent } from '../../utils/log'; diff --git a/app/views/CannedResponseDetail.tsx b/app/views/CannedResponseDetail.tsx index 91ea72c14..a4ef763f4 100644 --- a/app/views/CannedResponseDetail.tsx +++ b/app/views/CannedResponseDetail.tsx @@ -12,7 +12,7 @@ import { useTheme } from '../theme'; import RocketChat from '../lib/rocketchat'; import Navigation from '../lib/navigation/appNavigation'; import { goRoom } from '../utils/goRoom'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import Markdown from '../containers/markdown'; import { ICannedResponse } from '../definitions/ICannedResponse'; import { ChatsStackParamList } from '../stacks/types'; diff --git a/app/views/CannedResponsesListView/CannedResponseItem.tsx b/app/views/CannedResponsesListView/CannedResponseItem.tsx index d81e0e366..3b099a4f7 100644 --- a/app/views/CannedResponsesListView/CannedResponseItem.tsx +++ b/app/views/CannedResponsesListView/CannedResponseItem.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { View, Text } from 'react-native'; import Touchable from 'react-native-platform-touchable'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Button from '../../containers/Button'; import I18n from '../../i18n'; import styles from './styles'; diff --git a/app/views/CannedResponsesListView/Dropdown/DropdownItem.tsx b/app/views/CannedResponsesListView/Dropdown/DropdownItem.tsx index ebae90378..274a9cef6 100644 --- a/app/views/CannedResponsesListView/Dropdown/DropdownItem.tsx +++ b/app/views/CannedResponsesListView/Dropdown/DropdownItem.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { useTheme } from '../../../theme'; import Touch from '../../../utils/touch'; import { CustomIcon } from '../../../lib/Icons'; diff --git a/app/views/CannedResponsesListView/Dropdown/index.tsx b/app/views/CannedResponsesListView/Dropdown/index.tsx index d723bc4c8..d0f295a0e 100644 --- a/app/views/CannedResponsesListView/Dropdown/index.tsx +++ b/app/views/CannedResponsesListView/Dropdown/index.tsx @@ -3,7 +3,7 @@ import { Animated, Easing, FlatList, TouchableWithoutFeedback } from 'react-nati import { withSafeAreaInsets } from 'react-native-safe-area-context'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { withTheme } from '../../../theme'; import * as List from '../../../containers/List'; import { IDepartment } from '../../../definitions/ICannedResponse'; diff --git a/app/views/CannedResponsesListView/index.tsx b/app/views/CannedResponsesListView/index.tsx index c273efd4a..f8514f2dc 100644 --- a/app/views/CannedResponsesListView/index.tsx +++ b/app/views/CannedResponsesListView/index.tsx @@ -20,7 +20,7 @@ import Navigation from '../../lib/navigation/appNavigation'; import { goRoom } from '../../utils/goRoom'; import * as HeaderButton from '../../containers/HeaderButton'; import * as List from '../../containers/List'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import log from '../../utils/log'; import CannedResponseItem from './CannedResponseItem'; import Dropdown from './Dropdown'; diff --git a/app/views/ChangePasscodeView.tsx b/app/views/ChangePasscodeView.tsx index a69d8f557..a10da7a76 100644 --- a/app/views/ChangePasscodeView.tsx +++ b/app/views/ChangePasscodeView.tsx @@ -11,8 +11,7 @@ import { hasNotch, isTablet } from '../utils/deviceInfo'; import { PasscodeChoose } from '../containers/Passcode'; import EventEmitter from '../utils/events'; import { CustomIcon } from '../lib/Icons'; -import { CHANGE_PASSCODE_EMITTER } from '../constants/localAuthentication'; -import { themes } from '../constants/colors'; +import { CHANGE_PASSCODE_EMITTER, themes } from '../lib/constants'; const styles = StyleSheet.create({ modal: { diff --git a/app/views/CreateChannelView.tsx b/app/views/CreateChannelView.tsx index 43df75fbf..e7893ba12 100644 --- a/app/views/CreateChannelView.tsx +++ b/app/views/CreateChannelView.tsx @@ -14,7 +14,7 @@ import I18n from '../i18n'; import UserItem from '../presentation/UserItem'; import * as HeaderButton from '../containers/HeaderButton'; import StatusBar from '../containers/StatusBar'; -import { SWITCH_TRACK_COLOR, themes } from '../constants/colors'; +import { SWITCH_TRACK_COLOR, themes } from '../lib/constants'; import { withTheme } from '../theme'; import { Review } from '../utils/review'; import { getUserSelector } from '../selectors/login'; diff --git a/app/views/CreateDiscussionView/SelectChannel.tsx b/app/views/CreateDiscussionView/SelectChannel.tsx index 641a53f47..c97f2c360 100644 --- a/app/views/CreateDiscussionView/SelectChannel.tsx +++ b/app/views/CreateDiscussionView/SelectChannel.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Text } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { MultiSelect } from '../../containers/UIKit/MultiSelect'; import { ISearchLocal } from '../../definitions'; import I18n from '../../i18n'; diff --git a/app/views/CreateDiscussionView/SelectUsers.tsx b/app/views/CreateDiscussionView/SelectUsers.tsx index cee43dfb5..39d77f479 100644 --- a/app/views/CreateDiscussionView/SelectUsers.tsx +++ b/app/views/CreateDiscussionView/SelectUsers.tsx @@ -9,7 +9,7 @@ import RocketChat from '../../lib/rocketchat'; import database from '../../lib/database'; import I18n from '../../i18n'; import { MultiSelect } from '../../containers/UIKit/MultiSelect'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; import { ICreateDiscussionViewSelectUsers } from './interfaces'; import { SubscriptionType } from '../../definitions/ISubscription'; diff --git a/app/views/CreateDiscussionView/index.tsx b/app/views/CreateDiscussionView/index.tsx index 936ce3f3e..67e467b27 100644 --- a/app/views/CreateDiscussionView/index.tsx +++ b/app/views/CreateDiscussionView/index.tsx @@ -9,7 +9,6 @@ import scrollPersistTaps from '../../utils/scrollPersistTaps'; import I18n from '../../i18n'; import * as HeaderButton from '../../containers/HeaderButton'; import StatusBar from '../../containers/StatusBar'; -import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import TextInput from '../../containers/TextInput'; @@ -20,12 +19,12 @@ import { showErrorAlert } from '../../utils/info'; import SafeAreaView from '../../containers/SafeAreaView'; import { goRoom } from '../../utils/goRoom'; import { events, logEvent } from '../../utils/log'; -import { E2E_ROOM_TYPES } from '../../lib/constants'; import styles from './styles'; import SelectUsers from './SelectUsers'; import SelectChannel from './SelectChannel'; import { ICreateChannelViewProps, IResult, IError } from './interfaces'; import { IApplicationState } from '../../definitions'; +import { E2E_ROOM_TYPES, SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; class CreateChannelView extends React.Component { private channel: any; diff --git a/app/views/DefaultBrowserView.tsx b/app/views/DefaultBrowserView.tsx index 23ef073bf..ddc1906fc 100644 --- a/app/views/DefaultBrowserView.tsx +++ b/app/views/DefaultBrowserView.tsx @@ -4,7 +4,7 @@ import { FlatList, Linking } from 'react-native'; import I18n from '../i18n'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import StatusBar from '../containers/StatusBar'; import * as List from '../containers/List'; import { DEFAULT_BROWSER_KEY } from '../utils/openLink'; diff --git a/app/views/DirectoryView/Options.tsx b/app/views/DirectoryView/Options.tsx index ed7a6526e..efe0d2f38 100644 --- a/app/views/DirectoryView/Options.tsx +++ b/app/views/DirectoryView/Options.tsx @@ -5,7 +5,7 @@ import Touch from '../../utils/touch'; import { CustomIcon } from '../../lib/Icons'; import Check from '../../containers/Check'; import I18n from '../../i18n'; -import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; +import { SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; import styles from './styles'; const ANIMATION_DURATION = 200; diff --git a/app/views/DirectoryView/index.tsx b/app/views/DirectoryView/index.tsx index 7e7efafca..9cc0c3749 100644 --- a/app/views/DirectoryView/index.tsx +++ b/app/views/DirectoryView/index.tsx @@ -18,7 +18,7 @@ import * as HeaderButton from '../../containers/HeaderButton'; import debounce from '../../utils/debounce'; import log, { events, logEvent } from '../../utils/log'; import { withTheme } from '../../theme'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { getUserSelector } from '../../selectors/login'; import SafeAreaView from '../../containers/SafeAreaView'; import { goRoom } from '../../utils/goRoom'; diff --git a/app/views/DiscussionsView/DiscussionDetails.tsx b/app/views/DiscussionsView/DiscussionDetails.tsx index 9ef19bbe9..169c13481 100644 --- a/app/views/DiscussionsView/DiscussionDetails.tsx +++ b/app/views/DiscussionsView/DiscussionDetails.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../Styles'; import { useTheme } from '../../theme'; import { IMessageFromServer } from '../../definitions'; diff --git a/app/views/DiscussionsView/Item.stories.js b/app/views/DiscussionsView/Item.stories.js index f909600db..d47ecd71e 100644 --- a/app/views/DiscussionsView/Item.stories.js +++ b/app/views/DiscussionsView/Item.stories.js @@ -5,7 +5,7 @@ import { ScrollView } from 'react-native'; import { Provider } from 'react-redux'; import * as List from '../../containers/List'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { ThemeContext } from '../../theme'; import { store } from '../../../storybook/stories'; import Item from './Item'; diff --git a/app/views/DiscussionsView/Item.tsx b/app/views/DiscussionsView/Item.tsx index 41c3174c1..c86bf42e0 100644 --- a/app/views/DiscussionsView/Item.tsx +++ b/app/views/DiscussionsView/Item.tsx @@ -6,7 +6,7 @@ import moment from 'moment'; import { useTheme } from '../../theme'; import Avatar from '../../containers/Avatar'; import sharedStyles from '../Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { MarkdownPreview } from '../../containers/markdown'; import { formatDateThreads, makeThreadName } from '../../utils/room'; import DiscussionDetails from './DiscussionDetails'; diff --git a/app/views/DiscussionsView/index.tsx b/app/views/DiscussionsView/index.tsx index 93963b0c5..f2be34802 100644 --- a/app/views/DiscussionsView/index.tsx +++ b/app/views/DiscussionsView/index.tsx @@ -12,7 +12,7 @@ import I18n from '../../i18n'; import StatusBar from '../../containers/StatusBar'; import log from '../../utils/log'; import debounce from '../../utils/debounce'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import SafeAreaView from '../../containers/SafeAreaView'; import * as HeaderButton from '../../containers/HeaderButton'; import * as List from '../../containers/List'; diff --git a/app/views/DisplayPrefsView.tsx b/app/views/DisplayPrefsView.tsx index 4405cd0a7..2c0565f7b 100644 --- a/app/views/DisplayPrefsView.tsx +++ b/app/views/DisplayPrefsView.tsx @@ -5,8 +5,7 @@ import { RadioButton } from 'react-native-ui-lib'; import { useDispatch, useSelector } from 'react-redux'; import { setPreference } from '../actions/sortPreferences'; -import { themes } from '../constants/colors'; -import { DisplayMode, SortBy } from '../constants/constantDisplayMode'; +import { DisplayMode, SortBy, themes } from '../lib/constants'; import * as HeaderButton from '../containers/HeaderButton'; import * as List from '../containers/List'; import { ICON_SIZE } from '../containers/List/constants'; diff --git a/app/views/E2EEncryptionSecurityView.tsx b/app/views/E2EEncryptionSecurityView.tsx index 5c7cbac09..7cf1dcba0 100644 --- a/app/views/E2EEncryptionSecurityView.tsx +++ b/app/views/E2EEncryptionSecurityView.tsx @@ -14,7 +14,7 @@ import TextInput from '../containers/TextInput'; import Button from '../containers/Button'; import { getUserSelector } from '../selectors/login'; import { PADDING_HORIZONTAL } from '../containers/List/constants'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { Encryption } from '../lib/encryption'; import RocketChat from '../lib/rocketchat'; import { logout as logoutAction } from '../actions/login'; diff --git a/app/views/E2EEnterYourPasswordView.tsx b/app/views/E2EEnterYourPasswordView.tsx index 7b43e14c3..0486247ca 100644 --- a/app/views/E2EEnterYourPasswordView.tsx +++ b/app/views/E2EEnterYourPasswordView.tsx @@ -4,7 +4,7 @@ import { ScrollView, StyleSheet, Text, TextInput as RNTextInput } from 'react-na import { connect } from 'react-redux'; import { encryptionDecodeKey } from '../actions/encryption'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import Button from '../containers/Button'; import * as HeaderButton from '../containers/HeaderButton'; import SafeAreaView from '../containers/SafeAreaView'; diff --git a/app/views/E2EHowItWorksView.tsx b/app/views/E2EHowItWorksView.tsx index 607a196e7..8e1ed4245 100644 --- a/app/views/E2EHowItWorksView.tsx +++ b/app/views/E2EHowItWorksView.tsx @@ -4,7 +4,7 @@ import { RouteProp } from '@react-navigation/native'; import { StyleSheet } from 'react-native'; import SafeAreaView from '../containers/SafeAreaView'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import * as HeaderButton from '../containers/HeaderButton'; import Markdown from '../containers/markdown'; import { withTheme } from '../theme'; diff --git a/app/views/E2ESaveYourPasswordView.tsx b/app/views/E2ESaveYourPasswordView.tsx index 3d59fdfa3..663d05709 100644 --- a/app/views/E2ESaveYourPasswordView.tsx +++ b/app/views/E2ESaveYourPasswordView.tsx @@ -4,7 +4,6 @@ import Clipboard from '@react-native-clipboard/clipboard'; import { connect } from 'react-redux'; import { encryptionSetBanner } from '../actions/encryption'; -import { themes } from '../constants/colors'; import Button from '../containers/Button'; import * as HeaderButton from '../containers/HeaderButton'; import SafeAreaView from '../containers/SafeAreaView'; @@ -12,7 +11,7 @@ import StatusBar from '../containers/StatusBar'; import { LISTENER } from '../containers/Toast'; import { IApplicationState, IBaseScreen } from '../definitions'; import I18n from '../i18n'; -import { E2E_RANDOM_PASSWORD_KEY } from '../lib/constants'; +import { E2E_RANDOM_PASSWORD_KEY, themes } from '../lib/constants'; import UserPreferences from '../lib/methods/userPreferences'; import { E2ESaveYourPasswordStackParamList } from '../stacks/types'; import { withTheme } from '../theme'; diff --git a/app/views/ForgotPasswordView.tsx b/app/views/ForgotPasswordView.tsx index 0153f81fd..10a74e395 100644 --- a/app/views/ForgotPasswordView.tsx +++ b/app/views/ForgotPasswordView.tsx @@ -10,7 +10,7 @@ import isValidEmail from '../utils/isValidEmail'; import I18n from '../i18n'; import RocketChat from '../lib/rocketchat'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import FormContainer, { FormContainerInner } from '../containers/FormContainer'; import { events, logEvent } from '../utils/log'; import sharedStyles from './Styles'; diff --git a/app/views/ForwardLivechatView.tsx b/app/views/ForwardLivechatView.tsx index 9361e45f5..0df66356c 100644 --- a/app/views/ForwardLivechatView.tsx +++ b/app/views/ForwardLivechatView.tsx @@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'; import { useDispatch } from 'react-redux'; import { forwardRoom, ITransferData } from '../actions/room'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import OrSeparator from '../containers/OrSeparator'; import Input from '../containers/UIKit/MultiSelect/Input'; import { IBaseScreen, IServerRoom } from '../definitions'; diff --git a/app/views/InviteUsersEditView/index.tsx b/app/views/InviteUsersEditView/index.tsx index 10f356ae3..7e984d60c 100644 --- a/app/views/InviteUsersEditView/index.tsx +++ b/app/views/InviteUsersEditView/index.tsx @@ -5,7 +5,7 @@ import RNPickerSelect from 'react-native-picker-select'; import { connect } from 'react-redux'; import { inviteLinksCreate, inviteLinksSetParams } from '../../actions/inviteLinks'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Button from '../../containers/Button'; import * as List from '../../containers/List'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/InviteUsersView/index.tsx b/app/views/InviteUsersView/index.tsx index 5f10b32be..c7a6f225d 100644 --- a/app/views/InviteUsersView/index.tsx +++ b/app/views/InviteUsersView/index.tsx @@ -5,7 +5,7 @@ import { ScrollView, Share, View } from 'react-native'; import { connect } from 'react-redux'; import { inviteLinksClear, inviteLinksCreate } from '../../actions/inviteLinks'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Button from '../../containers/Button'; import Markdown from '../../containers/markdown'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/LanguageView/index.tsx b/app/views/LanguageView/index.tsx index af45f41ab..bd68834f6 100644 --- a/app/views/LanguageView/index.tsx +++ b/app/views/LanguageView/index.tsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { appStart } from '../../actions/app'; import { setUser } from '../../actions/login'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import * as List from '../../containers/List'; import SafeAreaView from '../../containers/SafeAreaView'; import StatusBar from '../../containers/StatusBar'; diff --git a/app/views/LivechatEditView.tsx b/app/views/LivechatEditView.tsx index bbd0d8ac7..4201168a0 100644 --- a/app/views/LivechatEditView.tsx +++ b/app/views/LivechatEditView.tsx @@ -6,7 +6,7 @@ import { connect } from 'react-redux'; import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import TextInput from '../containers/TextInput'; import KeyboardView from '../presentation/KeyboardView'; import RocketChat from '../lib/rocketchat'; diff --git a/app/views/LoginView.tsx b/app/views/LoginView.tsx index 0f66cba65..fcb548f25 100644 --- a/app/views/LoginView.tsx +++ b/app/views/LoginView.tsx @@ -4,7 +4,7 @@ import { Alert, Keyboard, StyleSheet, Text, View } from 'react-native'; import { connect } from 'react-redux'; import { loginRequest } from '../actions/login'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import Button from '../containers/Button'; import FormContainer, { FormContainerInner } from '../containers/FormContainer'; import * as HeaderButton from '../containers/HeaderButton'; diff --git a/app/views/MarkdownTableView.tsx b/app/views/MarkdownTableView.tsx index e260199e0..fa0f16a24 100644 --- a/app/views/MarkdownTableView.tsx +++ b/app/views/MarkdownTableView.tsx @@ -5,7 +5,7 @@ import { RouteProp } from '@react-navigation/native'; import I18n from '../i18n'; import { isIOS } from '../utils/deviceInfo'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { withTheme } from '../theme'; import { ChatsStackParamList } from '../stacks/types'; diff --git a/app/views/MessagesView/index.tsx b/app/views/MessagesView/index.tsx index 4eef9e8f7..a3f1ce658 100644 --- a/app/views/MessagesView/index.tsx +++ b/app/views/MessagesView/index.tsx @@ -12,7 +12,7 @@ import I18n from '../../i18n'; import RocketChat from '../../lib/rocketchat'; import StatusBar from '../../containers/StatusBar'; import getFileUrlFromMessage from '../../lib/methods/helpers/getFileUrlFromMessage'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import { withActionSheet } from '../../containers/ActionSheet'; diff --git a/app/views/ModalBlockView.tsx b/app/views/ModalBlockView.tsx index 119f45d7f..3aa134c8e 100644 --- a/app/views/ModalBlockView.tsx +++ b/app/views/ModalBlockView.tsx @@ -7,7 +7,7 @@ import { KeyboardAwareScrollView } from '@codler/react-native-keyboard-aware-scr import { withTheme } from '../theme'; import EventEmitter from '../utils/events'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import * as HeaderButton from '../containers/HeaderButton'; import { modalBlockWithContext } from '../containers/UIKit/MessageBlock'; import RocketChat from '../lib/rocketchat'; diff --git a/app/views/NewMessageView.tsx b/app/views/NewMessageView.tsx index cfc7f0c7c..0304b7007 100644 --- a/app/views/NewMessageView.tsx +++ b/app/views/NewMessageView.tsx @@ -6,7 +6,7 @@ import { FlatList, StyleSheet, Text, View } from 'react-native'; import { connect } from 'react-redux'; import { createChannelRequest } from '../actions/createChannel'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import * as HeaderButton from '../containers/HeaderButton'; import * as List from '../containers/List'; import SafeAreaView from '../containers/SafeAreaView'; diff --git a/app/views/NewServerView/ServerInput/Item.tsx b/app/views/NewServerView/ServerInput/Item.tsx index a73f455a0..b873bbba3 100644 --- a/app/views/NewServerView/ServerInput/Item.tsx +++ b/app/views/NewServerView/ServerInput/Item.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { BorderlessButton } from 'react-native-gesture-handler'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { CustomIcon } from '../../../lib/Icons'; import sharedStyles from '../../Styles'; import Touch from '../../../utils/touch'; diff --git a/app/views/NewServerView/ServerInput/index.tsx b/app/views/NewServerView/ServerInput/index.tsx index 7868754f3..fd7961762 100644 --- a/app/views/NewServerView/ServerInput/index.tsx +++ b/app/views/NewServerView/ServerInput/index.tsx @@ -3,7 +3,7 @@ import { FlatList, StyleSheet, TextInputProps, View } from 'react-native'; import TextInput from '../../../containers/TextInput'; import * as List from '../../../containers/List'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import I18n from '../../../i18n'; import { TServerHistoryModel } from '../../../definitions/IServerHistory'; import Item from './Item'; diff --git a/app/views/NewServerView/index.tsx b/app/views/NewServerView/index.tsx index e5e775ab6..20da385f2 100644 --- a/app/views/NewServerView/index.tsx +++ b/app/views/NewServerView/index.tsx @@ -9,7 +9,7 @@ import parse from 'url-parse'; import { inviteLinksClear } from '../../actions/inviteLinks'; import { selectServerRequest, serverFinishAdd, serverRequest } from '../../actions/server'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Button from '../../containers/Button'; import FormContainer, { FormContainerInner } from '../../containers/FormContainer'; import * as HeaderButton from '../../containers/HeaderButton'; diff --git a/app/views/NotificationPreferencesView/index.tsx b/app/views/NotificationPreferencesView/index.tsx index bf76d9e38..34590a7e8 100644 --- a/app/views/NotificationPreferencesView/index.tsx +++ b/app/views/NotificationPreferencesView/index.tsx @@ -6,7 +6,7 @@ import Model from '@nozbe/watermelondb/Model'; import { Observable, Subscription } from 'rxjs'; import database from '../../lib/database'; -import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; +import { SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; import StatusBar from '../../containers/StatusBar'; import * as List from '../../containers/List'; import I18n from '../../i18n'; diff --git a/app/views/PickerView.tsx b/app/views/PickerView.tsx index c00d00c83..3bb480b15 100644 --- a/app/views/PickerView.tsx +++ b/app/views/PickerView.tsx @@ -5,7 +5,7 @@ import { FlatList, StyleSheet, Text, View } from 'react-native'; import I18n from '../i18n'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import debounce from '../utils/debounce'; import * as List from '../containers/List'; import SearchBox from '../containers/SearchBox'; diff --git a/app/views/ProfileView/index.tsx b/app/views/ProfileView/index.tsx index d7ecbc399..2d0724f8f 100644 --- a/app/views/ProfileView/index.tsx +++ b/app/views/ProfileView/index.tsx @@ -26,7 +26,7 @@ import { setUser as setUserAction } from '../../actions/login'; import { CustomIcon } from '../../lib/Icons'; import * as HeaderButton from '../../containers/HeaderButton'; import StatusBar from '../../containers/StatusBar'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/ReadReceiptView/index.tsx b/app/views/ReadReceiptView/index.tsx index 01e628302..e997538cb 100644 --- a/app/views/ReadReceiptView/index.tsx +++ b/app/views/ReadReceiptView/index.tsx @@ -13,7 +13,7 @@ import I18n from '../../i18n'; import RocketChat from '../../lib/rocketchat'; import StatusBar from '../../containers/StatusBar'; import { withTheme } from '../../theme'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import SafeAreaView from '../../containers/SafeAreaView'; import styles from './styles'; import { ChatsStackParamList } from '../../stacks/types'; diff --git a/app/views/RegisterView.tsx b/app/views/RegisterView.tsx index b9e43bec3..b0dd24af6 100644 --- a/app/views/RegisterView.tsx +++ b/app/views/RegisterView.tsx @@ -4,7 +4,7 @@ import RNPickerSelect from 'react-native-picker-select'; import { connect } from 'react-redux'; import { loginRequest } from '../actions/login'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import Button from '../containers/Button'; import FormContainer, { FormContainerInner } from '../containers/FormContainer'; import * as HeaderButton from '../containers/HeaderButton'; diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index d3e2d3e88..8b668e735 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -8,7 +8,6 @@ import { Observable, Subscription } from 'rxjs'; import { closeRoom, leaveRoom } from '../../actions/room'; import { setLoading } from '../../actions/selectedUsers'; -import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; import Avatar from '../../containers/Avatar'; import * as HeaderButton from '../../containers/HeaderButton'; import * as List from '../../containers/List'; @@ -21,7 +20,6 @@ import { IApplicationState, IBaseScreen, IRoom, ISubscription, IUser, TSubscript import { withDimensions } from '../../dimensions'; import I18n from '../../i18n'; import database from '../../lib/database'; -import { E2E_ROOM_TYPES } from '../../lib/constants'; import protectedFunction from '../../lib/methods/helpers/protectedFunction'; import RocketChat from '../../lib/rocketchat'; import { getUserSelector } from '../../selectors/login'; @@ -33,6 +31,7 @@ import Touch from '../../utils/touch'; import sharedStyles from '../Styles'; import styles from './styles'; import { ERoomType } from '../../definitions/ERoomType'; +import { E2E_ROOM_TYPES, SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; import { compareServerVersion } from '../../lib/methods/helpers/compareServerVersion'; interface IRoomActionsViewProps extends IBaseScreen { diff --git a/app/views/RoomInfoEditView/SwitchContainer.tsx b/app/views/RoomInfoEditView/SwitchContainer.tsx index 0ae854e7e..7010a6bd1 100644 --- a/app/views/RoomInfoEditView/SwitchContainer.tsx +++ b/app/views/RoomInfoEditView/SwitchContainer.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Switch, Text, TextStyle, View, ViewStyle } from 'react-native'; -import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; +import { SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; import styles from './styles'; interface ISwitchContainer { diff --git a/app/views/RoomInfoEditView/index.tsx b/app/views/RoomInfoEditView/index.tsx index bebd8f502..d96b1553b 100644 --- a/app/views/RoomInfoEditView/index.tsx +++ b/app/views/RoomInfoEditView/index.tsx @@ -8,7 +8,7 @@ import ImagePicker, { Image } from 'react-native-image-crop-picker'; import { connect } from 'react-redux'; import { deleteRoom } from '../../actions/room'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Avatar from '../../containers/Avatar'; import Loading from '../../containers/Loading'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/RoomInfoView/Direct.tsx b/app/views/RoomInfoView/Direct.tsx index b9e9e0da7..a3dffced3 100644 --- a/app/views/RoomInfoView/Direct.tsx +++ b/app/views/RoomInfoView/Direct.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, View } from 'react-native'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import I18n from '../../i18n'; import { useTheme } from '../../theme'; import Timezone from './Timezone'; diff --git a/app/views/RoomInfoView/Item.tsx b/app/views/RoomInfoView/Item.tsx index 7296f6542..bc37e6b60 100644 --- a/app/views/RoomInfoView/Item.tsx +++ b/app/views/RoomInfoView/Item.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text, View } from 'react-native'; import Markdown from '../../containers/markdown'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import styles from './styles'; diff --git a/app/views/RoomInfoView/Livechat.tsx b/app/views/RoomInfoView/Livechat.tsx index ddc630979..e0d8ba316 100644 --- a/app/views/RoomInfoView/Livechat.tsx +++ b/app/views/RoomInfoView/Livechat.tsx @@ -4,7 +4,7 @@ import { StyleSheet, Text } from 'react-native'; import RocketChat from '../../lib/rocketchat'; import { useTheme } from '../../theme'; import sharedStyles from '../Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import I18n from '../../i18n'; import { ISubscription } from '../../definitions'; import { ILivechatVisitorModified } from './index'; diff --git a/app/views/RoomInfoView/index.tsx b/app/views/RoomInfoView/index.tsx index dfcbd95ed..528b9e067 100644 --- a/app/views/RoomInfoView/index.tsx +++ b/app/views/RoomInfoView/index.tsx @@ -18,7 +18,7 @@ import I18n from '../../i18n'; import * as HeaderButton from '../../containers/HeaderButton'; import StatusBar from '../../containers/StatusBar'; import log, { events, logEvent } from '../../utils/log'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { MarkdownPreview } from '../../containers/markdown'; import { LISTENER } from '../../containers/Toast'; diff --git a/app/views/RoomMembersView/index.tsx b/app/views/RoomMembersView/index.tsx index 866924cbe..61a2be851 100644 --- a/app/views/RoomMembersView/index.tsx +++ b/app/views/RoomMembersView/index.tsx @@ -4,7 +4,7 @@ import { FlatList } from 'react-native'; import { connect } from 'react-redux'; import { Observable, Subscription } from 'rxjs'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withActionSheet } from '../../containers/ActionSheet'; import ActivityIndicator from '../../containers/ActivityIndicator'; import * as HeaderButton from '../../containers/HeaderButton'; diff --git a/app/views/RoomView/Banner.tsx b/app/views/RoomView/Banner.tsx index e88cfe7e2..bbfe254e0 100644 --- a/app/views/RoomView/Banner.tsx +++ b/app/views/RoomView/Banner.tsx @@ -5,7 +5,7 @@ import Modal from 'react-native-modal'; import Markdown, { MarkdownPreview } from '../../containers/markdown'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import styles from './styles'; import { useTheme } from '../../theme'; diff --git a/app/views/RoomView/JoinCode.tsx b/app/views/RoomView/JoinCode.tsx index 741de6218..8b6bb7e87 100644 --- a/app/views/RoomView/JoinCode.tsx +++ b/app/views/RoomView/JoinCode.tsx @@ -8,7 +8,7 @@ import Button from '../../containers/Button'; import TextInput from '../../containers/TextInput'; import RocketChat from '../../lib/rocketchat'; import sharedStyles from '../Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { IApplicationState } from '../../definitions'; const styles = StyleSheet.create({ diff --git a/app/views/RoomView/LeftButtons.tsx b/app/views/RoomView/LeftButtons.tsx index b57409c10..a1639e652 100644 --- a/app/views/RoomView/LeftButtons.tsx +++ b/app/views/RoomView/LeftButtons.tsx @@ -2,7 +2,7 @@ import React, { useCallback } from 'react'; import { StyleSheet } from 'react-native'; import { HeaderBackButton, StackNavigationProp } from '@react-navigation/stack'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import Avatar from '../../containers/Avatar'; import { ChatsStackParamList } from '../../stacks/types'; diff --git a/app/views/RoomView/List/NavBottomFAB.tsx b/app/views/RoomView/List/NavBottomFAB.tsx index 0fb3c7f19..e1fbdaafa 100644 --- a/app/views/RoomView/List/NavBottomFAB.tsx +++ b/app/views/RoomView/List/NavBottomFAB.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { StyleSheet, View } from 'react-native'; import Animated, { call, cond, greaterOrEq, useCode } from 'react-native-reanimated'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { CustomIcon } from '../../../lib/Icons'; import { useTheme } from '../../../theme'; import Touch from '../../../utils/touch'; diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx index eae6fa8c7..11802973f 100644 --- a/app/views/RoomView/List/index.tsx +++ b/app/views/RoomView/List/index.tsx @@ -6,7 +6,7 @@ import { FlatListProps, RefreshControl, ViewToken } from 'react-native'; import { event, Value } from 'react-native-reanimated'; import { Observable, Subscription } from 'rxjs'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import ActivityIndicator from '../../../containers/ActivityIndicator'; import { TAnyMessageModel, TMessageModel, TThreadMessageModel, TThreadModel } from '../../../definitions'; import database from '../../../lib/database'; diff --git a/app/views/RoomView/LoadMore/LoadMore.stories.js b/app/views/RoomView/LoadMore/LoadMore.stories.js index 7f8137d1c..8d13d55ca 100644 --- a/app/views/RoomView/LoadMore/LoadMore.stories.js +++ b/app/views/RoomView/LoadMore/LoadMore.stories.js @@ -6,8 +6,7 @@ import { storiesOf } from '@storybook/react-native'; import { longText } from '../../../../storybook/utils'; import { ThemeContext } from '../../../theme'; import { Message, MessageDecorator, StoryProvider } from '../../../../storybook/stories/Message'; -import { themes } from '../../../constants/colors'; -import { MessageTypeLoad } from '../../../constants/messageTypeLoad'; +import { MessageTypeLoad, themes } from '../../../lib/constants'; import LoadMore from './index'; const stories = storiesOf('LoadMore', module); diff --git a/app/views/RoomView/LoadMore/index.tsx b/app/views/RoomView/LoadMore/index.tsx index 7dcd85ea6..fcd353924 100644 --- a/app/views/RoomView/LoadMore/index.tsx +++ b/app/views/RoomView/LoadMore/index.tsx @@ -1,8 +1,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { ActivityIndicator, StyleSheet, Text } from 'react-native'; -import { themes } from '../../../constants/colors'; -import { MessageTypeLoad } from '../../../constants/messageTypeLoad'; +import { MessageTypeLoad, themes } from '../../../lib/constants'; import { MessageType } from '../../../definitions'; import { useTheme } from '../../../theme'; import Touch from '../../../utils/touch'; diff --git a/app/views/RoomView/ReactionPicker.tsx b/app/views/RoomView/ReactionPicker.tsx index b47711b6e..9af5a714a 100644 --- a/app/views/RoomView/ReactionPicker.tsx +++ b/app/views/RoomView/ReactionPicker.tsx @@ -5,7 +5,7 @@ import Modal from 'react-native-modal'; import EmojiPicker from '../../containers/EmojiPicker'; import { isAndroid } from '../../utils/deviceInfo'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import styles from './styles'; import { IApplicationState } from '../../definitions'; diff --git a/app/views/RoomView/Separator.tsx b/app/views/RoomView/Separator.tsx index 8a125cf7d..9803ae72b 100644 --- a/app/views/RoomView/Separator.tsx +++ b/app/views/RoomView/Separator.tsx @@ -4,7 +4,7 @@ import moment from 'moment'; import I18n from '../../i18n'; import sharedStyles from '../Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; const styles = StyleSheet.create({ diff --git a/app/views/RoomView/UploadProgress.tsx b/app/views/RoomView/UploadProgress.tsx index fba6e9358..28a6b5966 100644 --- a/app/views/RoomView/UploadProgress.tsx +++ b/app/views/RoomView/UploadProgress.tsx @@ -8,7 +8,7 @@ import RocketChat from '../../lib/rocketchat'; import log from '../../utils/log'; import I18n from '../../i18n'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import sharedStyles from '../Styles'; import { withTheme } from '../../theme'; import { IUser, TUploadModel } from '../../definitions'; diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 7ff56c8b4..4cd521ad8 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -23,8 +23,6 @@ import EventEmitter from '../../utils/events'; import I18n from '../../i18n'; import RoomHeader from '../../containers/RoomHeader'; import StatusBar from '../../containers/StatusBar'; -import { themes } from '../../constants/colors'; -import { MESSAGE_TYPE_ANY_LOAD, MessageTypeLoad } from '../../constants/messageTypeLoad'; import debounce from '../../utils/debounce'; import ReactionsModal from '../../containers/ReactionsModal'; import { LISTENER } from '../../containers/Toast'; @@ -48,7 +46,6 @@ import Navigation from '../../lib/navigation/appNavigation'; import SafeAreaView from '../../containers/SafeAreaView'; import { withDimensions } from '../../dimensions'; import { getHeaderTitlePosition } from '../../containers/Header'; -import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../../lib/constants'; import { takeInquiry } from '../../ee/omnichannel/lib'; import Loading from '../../containers/Loading'; import { goRoom, TGoRoomItem } from '../../utils/goRoom'; @@ -82,6 +79,7 @@ import { TThreadModel } from '../../definitions'; import { ICustomEmojis } from '../../reducers/customEmojis'; +import { E2E_MESSAGE_TYPE, E2E_STATUS, MESSAGE_TYPE_ANY_LOAD, MessageTypeLoad, themes } from '../../lib/constants'; const stateAttrsUpdate = [ 'joined', diff --git a/app/views/RoomView/services/getMoreMessages.ts b/app/views/RoomView/services/getMoreMessages.ts index 99e22bbc4..d8e5b16e8 100644 --- a/app/views/RoomView/services/getMoreMessages.ts +++ b/app/views/RoomView/services/getMoreMessages.ts @@ -1,7 +1,7 @@ import { SubscriptionType, TAnyMessageModel } from '../../../definitions'; import loadMessagesForRoom from '../../../lib/methods/loadMessagesForRoom'; import loadNextMessages from '../../../lib/methods/loadNextMessages'; -import { MessageTypeLoad } from '../../../constants/messageTypeLoad'; +import { MessageTypeLoad } from '../../../lib/constants'; const getMoreMessages = ({ rid, diff --git a/app/views/RoomsListView/Header/Header.tsx b/app/views/RoomsListView/Header/Header.tsx index 581cfacf8..316cc34bd 100644 --- a/app/views/RoomsListView/Header/Header.tsx +++ b/app/views/RoomsListView/Header/Header.tsx @@ -4,7 +4,7 @@ import { StyleSheet, Text, TextInputProps, TouchableOpacity, TouchableOpacityPro import TextInput from '../../../presentation/TextInput'; import I18n from '../../../i18n'; import sharedStyles from '../../Styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { CustomIcon } from '../../../lib/Icons'; import { isIOS, isTablet } from '../../../utils/deviceInfo'; import { useOrientation } from '../../../dimensions'; diff --git a/app/views/RoomsListView/ListHeader/index.tsx b/app/views/RoomsListView/ListHeader/index.tsx index 1dbe9eb3b..57ee9a7bc 100644 --- a/app/views/RoomsListView/ListHeader/index.tsx +++ b/app/views/RoomsListView/ListHeader/index.tsx @@ -2,10 +2,9 @@ import React from 'react'; import { useTheme } from '../../../theme'; import * as List from '../../../containers/List'; -import { E2E_BANNER_TYPE } from '../../../lib/constants'; -import { themes } from '../../../constants/colors'; import OmnichannelStatus from '../../../ee/omnichannel/containers/OmnichannelStatus'; import { IUser } from '../../../definitions'; +import { E2E_BANNER_TYPE, themes } from '../../../lib/constants'; export type TEncryptionBanner = 'REQUEST_PASSWORD' | 'SAVE_PASSWORD'; diff --git a/app/views/RoomsListView/ServerDropdown.tsx b/app/views/RoomsListView/ServerDropdown.tsx index 408088291..e7db06a9b 100644 --- a/app/views/RoomsListView/ServerDropdown.tsx +++ b/app/views/RoomsListView/ServerDropdown.tsx @@ -14,7 +14,7 @@ import I18n from '../../i18n'; import EventEmitter from '../../utils/events'; import ServerItem from '../../presentation/ServerItem'; import database from '../../lib/database'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { KEY_COMMAND, handleCommandSelectServer, IKeyCommandEvent } from '../../commands'; import { isTablet } from '../../utils/deviceInfo'; diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index e2367b06d..d26e403ba 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -23,7 +23,6 @@ import ActivityIndicator from '../../containers/ActivityIndicator'; import { serverInitAdd } from '../../actions/server'; import { animateNextTransition } from '../../utils/layoutAnimation'; import { withTheme } from '../../theme'; -import { themes } from '../../constants/colors'; import EventEmitter from '../../utils/events'; import { KEY_COMMAND, @@ -36,24 +35,22 @@ import { handleCommandShowPreferences, IKeyCommandEvent } from '../../commands'; -import { MAX_SIDEBAR_WIDTH } from '../../constants/tablet'; import { getUserSelector } from '../../selectors/login'; import { goRoom } from '../../utils/goRoom'; import SafeAreaView from '../../containers/SafeAreaView'; import Header, { getHeaderTitlePosition } from '../../containers/Header'; import { withDimensions } from '../../dimensions'; import { showConfirmationAlert, showErrorAlert } from '../../utils/info'; -import { E2E_BANNER_TYPE } from '../../lib/constants'; import { getInquiryQueueSelector } from '../../ee/omnichannel/selectors/inquiry'; import { changeLivechatStatus, isOmnichannelStatusAvailable } from '../../ee/omnichannel/lib'; import { IApplicationState, IBaseScreen, ISubscription, IUser, RootEnum, TSubscriptionModel } from '../../definitions'; -import { DisplayMode, SortBy } from '../../constants/constantDisplayMode'; import styles from './styles'; import ServerDropdown from './ServerDropdown'; import ListHeader, { TEncryptionBanner } from './ListHeader'; import RoomsListHeaderView from './Header'; import { ChatsStackParamList } from '../../stacks/types'; import { RoomTypes } from '../../lib/methods/roomTypeToApiType'; +import { E2E_BANNER_TYPE, DisplayMode, SortBy, MAX_SIDEBAR_WIDTH, themes } from '../../lib/constants'; interface IRoomsListViewProps extends IBaseScreen { [key: string]: any; diff --git a/app/views/ScreenLockConfigView.tsx b/app/views/ScreenLockConfigView.tsx index 0c80123e6..febcbed63 100644 --- a/app/views/ScreenLockConfigView.tsx +++ b/app/views/ScreenLockConfigView.tsx @@ -6,12 +6,11 @@ import { Subscription } from 'rxjs'; import I18n from '../i18n'; import { withTheme } from '../theme'; -import { SWITCH_TRACK_COLOR, themes } from '../constants/colors'; import StatusBar from '../containers/StatusBar'; import * as List from '../containers/List'; import database from '../lib/database'; import { changePasscode, checkHasPasscode, supportedBiometryLabel } from '../utils/localAuthentication'; -import { BIOMETRY_ENABLED_KEY, DEFAULT_AUTO_LOCK } from '../constants/localAuthentication'; +import { BIOMETRY_ENABLED_KEY, DEFAULT_AUTO_LOCK, themes, SWITCH_TRACK_COLOR } from '../lib/constants'; import SafeAreaView from '../containers/SafeAreaView'; import { events, logEvent } from '../utils/log'; import { TServerModel } from '../definitions/IServer'; diff --git a/app/views/ScreenLockedView.tsx b/app/views/ScreenLockedView.tsx index c6e2efa0a..b4306688a 100644 --- a/app/views/ScreenLockedView.tsx +++ b/app/views/ScreenLockedView.tsx @@ -5,7 +5,7 @@ import isEmpty from 'lodash/isEmpty'; import Orientation from 'react-native-orientation-locker'; import EventEmitter from '../utils/events'; -import { LOCAL_AUTHENTICATE_EMITTER } from '../constants/localAuthentication'; +import { LOCAL_AUTHENTICATE_EMITTER } from '../lib/constants'; import { isTablet } from '../utils/deviceInfo'; import { PasscodeEnter } from '../containers/Passcode'; diff --git a/app/views/SearchMessagesView/index.tsx b/app/views/SearchMessagesView/index.tsx index ec8cc6d84..e4c74f93f 100644 --- a/app/views/SearchMessagesView/index.tsx +++ b/app/views/SearchMessagesView/index.tsx @@ -19,7 +19,7 @@ import { IMessage } from '../../containers/message/interfaces'; import I18n from '../../i18n'; import StatusBar from '../../containers/StatusBar'; import log from '../../utils/log'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/SecurityPrivacyView.tsx b/app/views/SecurityPrivacyView.tsx index 529964752..b62d1ad09 100644 --- a/app/views/SecurityPrivacyView.tsx +++ b/app/views/SecurityPrivacyView.tsx @@ -4,7 +4,6 @@ import { StackNavigationProp } from '@react-navigation/stack'; import AsyncStorage from '@react-native-community/async-storage'; import { useSelector } from 'react-redux'; -import { SWITCH_TRACK_COLOR } from '../constants/colors'; import StatusBar from '../containers/StatusBar'; import * as List from '../containers/List'; import I18n from '../i18n'; @@ -17,8 +16,7 @@ import { getReportAnalyticsEventsValue } from '../utils/log'; import SafeAreaView from '../containers/SafeAreaView'; -import { isFDroidBuild } from '../constants/environment'; -import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY } from '../lib/constants'; +import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY, isFDroidBuild, SWITCH_TRACK_COLOR } from '../lib/constants'; interface ISecurityPrivacyViewProps { navigation: StackNavigationProp; diff --git a/app/views/SelectListView.tsx b/app/views/SelectListView.tsx index 5a3a2d701..fffcecb45 100644 --- a/app/views/SelectListView.tsx +++ b/app/views/SelectListView.tsx @@ -11,7 +11,7 @@ import * as List from '../containers/List'; import I18n from '../i18n'; import * as HeaderButton from '../containers/HeaderButton'; import StatusBar from '../containers/StatusBar'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { withTheme } from '../theme'; import SafeAreaView from '../containers/SafeAreaView'; import { animateNextTransition } from '../utils/layoutAnimation'; diff --git a/app/views/SelectedUsersView.tsx b/app/views/SelectedUsersView.tsx index 2ce51b35d..dfe62aaf4 100644 --- a/app/views/SelectedUsersView.tsx +++ b/app/views/SelectedUsersView.tsx @@ -6,7 +6,7 @@ import { connect } from 'react-redux'; import { Subscription } from 'rxjs'; import { addUser, removeUser, reset } from '../actions/selectedUsers'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import * as HeaderButton from '../containers/HeaderButton'; import * as List from '../containers/List'; import Loading from '../containers/Loading'; diff --git a/app/views/SetUsernameView.tsx b/app/views/SetUsernameView.tsx index 4c9aa91f0..50b865082 100644 --- a/app/views/SetUsernameView.tsx +++ b/app/views/SetUsernameView.tsx @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { loginRequest } from '../actions/login'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import Button from '../containers/Button'; import SafeAreaView from '../containers/SafeAreaView'; import StatusBar from '../containers/StatusBar'; diff --git a/app/views/SettingsView/index.tsx b/app/views/SettingsView/index.tsx index 21e5bfae9..715d8eea9 100644 --- a/app/views/SettingsView/index.tsx +++ b/app/views/SettingsView/index.tsx @@ -9,9 +9,7 @@ import { connect } from 'react-redux'; import { appStart } from '../../actions/app'; import { logout } from '../../actions/login'; import { selectServerRequest } from '../../actions/server'; -import { themes } from '../../constants/colors'; -import { isFDroidBuild } from '../../constants/environment'; -import { APP_STORE_LINK, FDROID_MARKET_LINK, LICENSE_LINK, PLAY_MARKET_LINK } from '../../constants/links'; +import { APP_STORE_LINK, FDROID_MARKET_LINK, LICENSE_LINK, PLAY_MARKET_LINK, isFDroidBuild, themes } from '../../lib/constants'; import * as HeaderButton from '../../containers/HeaderButton'; import * as List from '../../containers/List'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/ShareListView/Header/Header.ios.tsx b/app/views/ShareListView/Header/Header.ios.tsx index c1f5e1166..7b01bd9b2 100644 --- a/app/views/ShareListView/Header/Header.ios.tsx +++ b/app/views/ShareListView/Header/Header.ios.tsx @@ -4,7 +4,7 @@ import ShareExtension from 'rn-extensions-share'; import SearchBox from '../../../containers/SearchBox'; import * as HeaderButton from '../../../containers/HeaderButton'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import sharedStyles from '../../Styles'; import { animateNextTransition } from '../../../utils/layoutAnimation'; import { IShareListHeaderIos } from './interface'; diff --git a/app/views/ShareListView/Header/Header.tsx b/app/views/ShareListView/Header/Header.tsx index 616f3f487..a3b017c48 100644 --- a/app/views/ShareListView/Header/Header.tsx +++ b/app/views/ShareListView/Header/Header.tsx @@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native'; import TextInput from '../../../presentation/TextInput'; import I18n from '../../../i18n'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import sharedStyles from '../../Styles'; import { IShareListHeader } from './interface'; diff --git a/app/views/ShareListView/index.tsx b/app/views/ShareListView/index.tsx index b89603242..c41478163 100644 --- a/app/views/ShareListView/index.tsx +++ b/app/views/ShareListView/index.tsx @@ -16,7 +16,7 @@ import ServerItem from '../../presentation/ServerItem'; import * as HeaderButton from '../../containers/HeaderButton'; import ActivityIndicator from '../../containers/ActivityIndicator'; import * as List from '../../containers/List'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { animateNextTransition } from '../../utils/layoutAnimation'; import { withTheme } from '../../theme'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/ShareView/Header.tsx b/app/views/ShareView/Header.tsx index fe6e9087b..ecbbbbe97 100644 --- a/app/views/ShareView/Header.tsx +++ b/app/views/ShareView/Header.tsx @@ -4,7 +4,7 @@ import { StyleSheet, Text, View } from 'react-native'; import I18n from '../../i18n'; import { CustomIcon } from '../../lib/Icons'; import RocketChat from '../../lib/rocketchat'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { useTheme } from '../../theme'; import { isAndroid, isTablet } from '../../utils/deviceInfo'; import sharedStyles from '../Styles'; diff --git a/app/views/ShareView/Preview.tsx b/app/views/ShareView/Preview.tsx index e7600dda6..18f4d3e30 100644 --- a/app/views/ShareView/Preview.tsx +++ b/app/views/ShareView/Preview.tsx @@ -6,15 +6,15 @@ import prettyBytes from 'pretty-bytes'; import { CustomIcon } from '../../lib/Icons'; import { ImageViewer, types } from '../../presentation/ImageViewer'; -import { themes } from '../../constants/colors'; import { useDimensions, useOrientation } from '../../dimensions'; import { getHeaderHeight } from '../../containers/Header'; import sharedStyles from '../Styles'; import I18n from '../../i18n'; import { isAndroid } from '../../utils/deviceInfo'; import { allowPreview } from './utils'; -import { THUMBS_HEIGHT } from './constants'; import { IAttachment, IUseDimensions } from './interfaces'; +import { THUMBS_HEIGHT } from './constants'; +import { themes } from '../../lib/constants'; const MESSAGEBOX_HEIGHT = 56; diff --git a/app/views/ShareView/Thumbs.tsx b/app/views/ShareView/Thumbs.tsx index da0808cc0..c5340d890 100644 --- a/app/views/ShareView/Thumbs.tsx +++ b/app/views/ShareView/Thumbs.tsx @@ -3,7 +3,7 @@ import { FlatList, Image, StyleSheet, View } from 'react-native'; import { RectButton, TouchableNativeFeedback, TouchableOpacity } from 'react-native-gesture-handler'; import { BUTTON_HIT_SLOP } from '../../containers/message/utils'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { CustomIcon } from '../../lib/Icons'; import { isIOS } from '../../utils/deviceInfo'; import { THUMBS_HEIGHT } from './constants'; diff --git a/app/views/ShareView/index.tsx b/app/views/ShareView/index.tsx index 8f06166a2..053573c7b 100644 --- a/app/views/ShareView/index.tsx +++ b/app/views/ShareView/index.tsx @@ -7,7 +7,7 @@ import ShareExtension from 'rn-extensions-share'; import { Q } from '@nozbe/watermelondb'; import { InsideStackParamList } from '../../stacks/types'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import I18n from '../../i18n'; import Loading from '../../containers/Loading'; import * as HeaderButton from '../../containers/HeaderButton'; diff --git a/app/views/SidebarView/SidebarItem.tsx b/app/views/SidebarView/SidebarItem.tsx index 6843732f1..8766e8037 100644 --- a/app/views/SidebarView/SidebarItem.tsx +++ b/app/views/SidebarView/SidebarItem.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Text, View } from 'react-native'; import Touch from '../../utils/touch'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import styles from './styles'; diff --git a/app/views/SidebarView/index.tsx b/app/views/SidebarView/index.tsx index 67f1af9bc..77db882db 100644 --- a/app/views/SidebarView/index.tsx +++ b/app/views/SidebarView/index.tsx @@ -11,7 +11,7 @@ import { events, logEvent } from '../../utils/log'; import I18n from '../../i18n'; import scrollPersistTaps from '../../utils/scrollPersistTaps'; import { CustomIcon } from '../../lib/Icons'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/Styles.js b/app/views/Styles.js index 89b036741..e2344e0ea 100644 --- a/app/views/Styles.js +++ b/app/views/Styles.js @@ -1,6 +1,6 @@ import { Platform, StyleSheet } from 'react-native'; -import { MAX_SCREEN_CONTENT_WIDTH } from '../constants/tablet'; +import { MAX_SCREEN_CONTENT_WIDTH } from '../lib/constants'; export default StyleSheet.create({ container: { diff --git a/app/views/TeamChannelsView.tsx b/app/views/TeamChannelsView.tsx index 330126f74..b4b2c52f2 100644 --- a/app/views/TeamChannelsView.tsx +++ b/app/views/TeamChannelsView.tsx @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { deleteRoom } from '../actions/room'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { withActionSheet } from '../containers/ActionSheet'; import ActivityIndicator from '../containers/ActivityIndicator'; import BackgroundContainer from '../containers/BackgroundContainer'; diff --git a/app/views/ThemeView.tsx b/app/views/ThemeView.tsx index 39bd3e36d..fb05d9dea 100644 --- a/app/views/ThemeView.tsx +++ b/app/views/ThemeView.tsx @@ -3,7 +3,6 @@ import { StackNavigationOptions } from '@react-navigation/stack'; import I18n from '../i18n'; import { withTheme } from '../theme'; -import { themes } from '../constants/colors'; import StatusBar from '../containers/StatusBar'; import * as List from '../containers/List'; import { supportSystemTheme } from '../utils/deviceInfo'; @@ -11,7 +10,7 @@ import SafeAreaView from '../containers/SafeAreaView'; import UserPreferences from '../lib/methods/userPreferences'; import { events, logEvent } from '../utils/log'; import { IThemePreference, TThemeMode, TDarkLevel } from '../definitions/ITheme'; -import { THEME_PREFERENCES_KEY } from '../lib/constants'; +import { THEME_PREFERENCES_KEY, themes } from '../lib/constants'; const THEME_GROUP = 'THEME_GROUP'; const DARK_GROUP = 'DARK_GROUP'; diff --git a/app/views/ThreadMessagesView/Dropdown/DropdownItem.tsx b/app/views/ThreadMessagesView/Dropdown/DropdownItem.tsx index c2bbd4960..11e552f85 100644 --- a/app/views/ThreadMessagesView/Dropdown/DropdownItem.tsx +++ b/app/views/ThreadMessagesView/Dropdown/DropdownItem.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { withTheme } from '../../../theme'; import Touch from '../../../utils/touch'; import { CustomIcon } from '../../../lib/Icons'; diff --git a/app/views/ThreadMessagesView/Dropdown/index.tsx b/app/views/ThreadMessagesView/Dropdown/index.tsx index d21a78fc5..ef02c0f09 100644 --- a/app/views/ThreadMessagesView/Dropdown/index.tsx +++ b/app/views/ThreadMessagesView/Dropdown/index.tsx @@ -3,7 +3,7 @@ import { Animated, Easing, TouchableWithoutFeedback } from 'react-native'; import { EdgeInsets, withSafeAreaInsets } from 'react-native-safe-area-context'; import styles from '../styles'; -import { themes } from '../../../constants/colors'; +import { themes } from '../../../lib/constants'; import { withTheme } from '../../../theme'; import { headerHeight } from '../../../containers/Header'; import * as List from '../../../containers/List'; diff --git a/app/views/ThreadMessagesView/Item.stories.js b/app/views/ThreadMessagesView/Item.stories.js index b213f4d7c..5a98fb10c 100644 --- a/app/views/ThreadMessagesView/Item.stories.js +++ b/app/views/ThreadMessagesView/Item.stories.js @@ -5,7 +5,7 @@ import { ScrollView } from 'react-native'; import { Provider } from 'react-redux'; import * as List from '../../containers/List'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { ThemeContext } from '../../theme'; import { store } from '../../../storybook/stories'; import Item from './Item'; diff --git a/app/views/ThreadMessagesView/Item.tsx b/app/views/ThreadMessagesView/Item.tsx index d5b7a2b55..e5339f437 100644 --- a/app/views/ThreadMessagesView/Item.tsx +++ b/app/views/ThreadMessagesView/Item.tsx @@ -5,7 +5,7 @@ import Touchable from 'react-native-platform-touchable'; import { useTheme } from '../../theme'; import Avatar from '../../containers/Avatar'; import sharedStyles from '../Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { MarkdownPreview } from '../../containers/markdown'; import { formatDateThreads, makeThreadName } from '../../utils/room'; import ThreadDetails from '../../containers/ThreadDetails'; diff --git a/app/views/ThreadMessagesView/index.tsx b/app/views/ThreadMessagesView/index.tsx index 2c6dcc6a4..d967aaafc 100644 --- a/app/views/ThreadMessagesView/index.tsx +++ b/app/views/ThreadMessagesView/index.tsx @@ -18,7 +18,7 @@ import buildMessage from '../../lib/methods/helpers/buildMessage'; import log from '../../utils/log'; import debounce from '../../utils/debounce'; import protectedFunction from '../../lib/methods/helpers/protectedFunction'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/UserNotificationPreferencesView/index.tsx b/app/views/UserNotificationPreferencesView/index.tsx index 1b9a5cd83..fe4bdece8 100644 --- a/app/views/UserNotificationPreferencesView/index.tsx +++ b/app/views/UserNotificationPreferencesView/index.tsx @@ -3,7 +3,7 @@ import { StyleSheet, Text } from 'react-native'; import { StackNavigationOptions, StackNavigationProp } from '@react-navigation/stack'; import { connect } from 'react-redux'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import StatusBar from '../../containers/StatusBar'; import * as List from '../../containers/List'; import I18n from '../../i18n'; diff --git a/app/views/UserPreferencesView/index.tsx b/app/views/UserPreferencesView/index.tsx index 4a2b1b042..a2319c036 100644 --- a/app/views/UserPreferencesView/index.tsx +++ b/app/views/UserPreferencesView/index.tsx @@ -9,7 +9,7 @@ import log, { logEvent, events } from '../../utils/log'; import SafeAreaView from '../../containers/SafeAreaView'; import StatusBar from '../../containers/StatusBar'; import * as List from '../../containers/List'; -import { SWITCH_TRACK_COLOR } from '../../constants/colors'; +import { SWITCH_TRACK_COLOR } from '../../lib/constants'; import { getUserSelector } from '../../selectors/login'; import RocketChat from '../../lib/rocketchat'; import { ProfileStackParamList } from '../../stacks/types'; diff --git a/app/views/WithoutServersView.tsx b/app/views/WithoutServersView.tsx index 43ceacc2d..2fc342ffd 100644 --- a/app/views/WithoutServersView.tsx +++ b/app/views/WithoutServersView.tsx @@ -5,7 +5,7 @@ import ShareExtension from 'rn-extensions-share'; import * as HeaderButton from '../containers/HeaderButton'; import sharedStyles from './Styles'; import I18n from '../i18n'; -import { themes } from '../constants/colors'; +import { themes } from '../lib/constants'; import { withTheme } from '../theme'; const styles = StyleSheet.create({ diff --git a/app/views/WorkspaceView/ServerAvatar.tsx b/app/views/WorkspaceView/ServerAvatar.tsx index 54b90b9bb..435c23488 100644 --- a/app/views/WorkspaceView/ServerAvatar.tsx +++ b/app/views/WorkspaceView/ServerAvatar.tsx @@ -5,7 +5,7 @@ import * as Progress from 'react-native-progress'; import FastImage from '@rocket.chat/react-native-fast-image'; import sharedStyles from '../Styles'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { isTablet } from '../../utils/deviceInfo'; const ImageProgress = createImageProgress(FastImage); diff --git a/app/views/WorkspaceView/index.tsx b/app/views/WorkspaceView/index.tsx index ed7155a02..12ff38396 100644 --- a/app/views/WorkspaceView/index.tsx +++ b/app/views/WorkspaceView/index.tsx @@ -7,7 +7,7 @@ import { CompositeNavigationProp } from '@react-navigation/core'; import { OutsideModalParamList, OutsideParamList } from '../../stacks/types'; import I18n from '../../i18n'; import Button from '../../containers/Button'; -import { themes } from '../../constants/colors'; +import { themes } from '../../lib/constants'; import { withTheme } from '../../theme'; import FormContainer, { FormContainerInner } from '../../containers/FormContainer'; import { getShowLoginButton } from '../../selectors/login'; diff --git a/storybook/stories/Markdown.tsx b/storybook/stories/Markdown.tsx index 771d939cc..3b0bff80b 100644 --- a/storybook/stories/Markdown.tsx +++ b/storybook/stories/Markdown.tsx @@ -3,7 +3,7 @@ import { ScrollView, StyleSheet, View } from 'react-native'; import { storiesOf } from '@storybook/react-native'; import Markdown, { MarkdownPreview } from '../../app/containers/markdown'; -import { themes } from '../../app/constants/colors'; +import { themes } from '../../app/lib/constants'; import { TGetCustomEmoji, IEmoji } from '../../app/definitions/IEmoji'; const theme = 'light'; diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index 610055082..81b298fa2 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -3,13 +3,11 @@ import React from 'react'; import { ScrollView, StyleSheet } from 'react-native'; import { Provider } from 'react-redux'; import { storiesOf } from '@storybook/react-native'; -// import moment from 'moment'; import MessageComponent from '../../app/containers/message/Message'; -import messagesStatus from '../../app/constants/messagesStatus'; +import { messagesStatus, themes } from '../../app/lib/constants'; import MessageSeparator from '../../app/views/RoomView/Separator'; import MessageContext from '../../app/containers/message/Context'; -import { themes } from '../../app/constants/colors'; import { store } from './index'; const _theme = 'light'; diff --git a/storybook/stories/NewMarkdown.js b/storybook/stories/NewMarkdown.js index e6d6be320..04799e5f5 100644 --- a/storybook/stories/NewMarkdown.js +++ b/storybook/stories/NewMarkdown.js @@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'; import { storiesOf } from '@storybook/react-native'; import NewMarkdown from '../../app/containers/markdown/new'; -import { themes } from '../../app/constants/colors'; +import { themes } from '../../app/lib/constants'; import { longText } from '../utils'; const stories = storiesOf('NewMarkdown', module); diff --git a/storybook/stories/RoomItem.js b/storybook/stories/RoomItem.js index e6ae40e7b..46ecddd25 100644 --- a/storybook/stories/RoomItem.js +++ b/storybook/stories/RoomItem.js @@ -4,10 +4,9 @@ import { Dimensions, ScrollView } from 'react-native'; import { storiesOf } from '@storybook/react-native'; import { Provider } from 'react-redux'; -import { themes } from '../../app/constants/colors'; import RoomItemComponent from '../../app/presentation/RoomItem/RoomItem'; import { longText } from '../utils'; -import { DisplayMode } from '../../app/constants/constantDisplayMode'; +import { DisplayMode, themes } from '../../app/lib/constants'; import { store } from './index'; const baseUrl = 'https://open.rocket.chat'; diff --git a/storybook/stories/UiKitMessage.js b/storybook/stories/UiKitMessage.js index a9a9aba94..9e05621ca 100644 --- a/storybook/stories/UiKitMessage.js +++ b/storybook/stories/UiKitMessage.js @@ -5,7 +5,7 @@ import { storiesOf } from '@storybook/react-native'; import MessageContext from '../../app/containers/message/Context'; import { UiKitMessage } from '../../app/containers/UIKit'; -import { themes } from '../../app/constants/colors'; +import { themes } from '../../app/lib/constants'; const styles = StyleSheet.create({ container: { diff --git a/storybook/stories/UiKitModal.js b/storybook/stories/UiKitModal.js index 6b3c22f40..6c417b58c 100644 --- a/storybook/stories/UiKitModal.js +++ b/storybook/stories/UiKitModal.js @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react-native'; import { UiKitComponent, UiKitModal } from '../../app/containers/UIKit'; import { KitContext, defaultContext } from '../../app/containers/UIKit/utils'; import MessageContext from '../../app/containers/message/Context'; -import { themes } from '../../app/constants/colors'; +import { themes } from '../../app/lib/constants'; const styles = StyleSheet.create({ container: {