From 754508c2d9132d62eb4c68dbde723be1cc726b53 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 29 Jan 2019 17:52:56 -0200 Subject: [PATCH] Update dependencies (#587) --- __mocks__/react-native-device-info.js | 4 + __mocks__/react-native-navigation.js | 19 +- app/Icons.js | 3 +- app/constants/headerOptions.js | 2 + app/containers/EmojiPicker/EmojiCategory.js | 6 +- app/containers/MessageBox/Recording.js | 11 +- app/containers/MessageBox/UploadModal.js | 5 +- app/containers/MessageBox/styles.js | 6 +- app/containers/SearchBox.js | 5 +- app/containers/Sidebar.js | 4 +- app/containers/message/Video.js | 5 +- app/index.js | 18 +- app/lib/rocketchat.js | 5 +- app/presentation/RoomItem.js | 7 +- app/presentation/UserItem.js | 5 +- app/utils/deviceInfo.js | 13 +- app/views/CreateChannelView.js | 11 +- app/views/LegalView.js | 7 +- app/views/MentionedMessagesView/index.js | 4 - app/views/NewMessageView.js | 12 +- app/views/NewServerView.js | 6 +- app/views/OAuthView.js | 9 +- app/views/OnboardingView/index.js | 6 +- app/views/PinnedMessagesView/index.js | 4 - app/views/ProfileView/index.js | 4 - app/views/RoomActionsView/index.js | 4 - app/views/RoomFilesView/index.js | 4 - app/views/RoomInfoEditView/index.js | 4 - app/views/RoomInfoView/index.js | 5 - app/views/RoomMembersView/index.js | 13 +- app/views/RoomView/Header/index.js | 16 +- app/views/RoomView/ReactionPicker.js | 5 +- app/views/RoomView/index.js | 8 +- app/views/RoomView/styles.js | 1 - app/views/RoomsListView/index.js | 23 +- app/views/RoomsListView/styles.js | 19 +- app/views/SearchMessagesView/index.js | 4 - app/views/SelectedUsersView.js | 14 +- app/views/SettingsView/index.js | 4 - app/views/SnippetedMessagesView/index.js | 4 - app/views/StarredMessagesView/index.js | 4 - app/views/Styles.js | 3 +- e2e/06-roomslist.spec.js | 4 +- e2e/07-createroom.spec.js | 1 + e2e/08-room.spec.js | 3 +- e2e/09-roomactions.spec.js | 3 +- e2e/10-roominfo.spec.js | 6 +- e2e/12-broadcast.spec.js | 3 +- e2e/14-joinpublicroom.spec.js | 4 +- e2e/data.js | 4 +- e2e/init.js | 2 +- ios/Podfile.lock | 38 +- .../Private/React/React/RCTWKWebView.h | 1 + .../Private/React/React/RCTWKWebViewManager.h | 1 + .../Headers/Public/React/React/RCTWKWebView.h | 1 + .../Public/React/React/RCTWKWebViewManager.h | 1 + ios/Pods/Local Podspecs/React.podspec.json | 6 +- ios/Pods/Local Podspecs/yoga.podspec.json | 4 +- ios/Pods/Manifest.lock | 38 +- ios/Pods/Pods.xcodeproj/project.pbxproj | 1246 +- .../RSKImageCropViewController.m | 6 +- package-lock.json | 10237 +++++++++------- package.json | 74 +- storybook/.babelrc | 4 + storybook/index.android.js | 2 + storybook/index.ios.js | 2 + storybook/index.js | 3 - storybook/storybook.js | 13 +- 68 files changed, 6697 insertions(+), 5326 deletions(-) create mode 100644 __mocks__/react-native-device-info.js create mode 120000 ios/Pods/Headers/Private/React/React/RCTWKWebView.h create mode 120000 ios/Pods/Headers/Private/React/React/RCTWKWebViewManager.h create mode 120000 ios/Pods/Headers/Public/React/React/RCTWKWebView.h create mode 120000 ios/Pods/Headers/Public/React/React/RCTWKWebViewManager.h create mode 100644 storybook/.babelrc delete mode 100644 storybook/index.js diff --git a/__mocks__/react-native-device-info.js b/__mocks__/react-native-device-info.js new file mode 100644 index 000000000..746f49549 --- /dev/null +++ b/__mocks__/react-native-device-info.js @@ -0,0 +1,4 @@ +export default { + getModel: () => '', + getReadableVersion: () => '' +}; diff --git a/__mocks__/react-native-navigation.js b/__mocks__/react-native-navigation.js index 1ea9fa342..b1c2af5e6 100644 --- a/__mocks__/react-native-navigation.js +++ b/__mocks__/react-native-navigation.js @@ -1,4 +1,17 @@ -export const Navigation = { - registerComponent: () => {}, - startSingleScreenApp: () => {} +class Events { + registerAppLaunchedListener = () => {} +} +const events = new Events(); +class NavigationClass { + registerComponent = () => {} + + setRoot = () => {} + + events = () => events +} + +const Navigation = new NavigationClass(); + +export { + Navigation }; diff --git a/app/Icons.js b/app/Icons.js index 968a72379..29fdb18ad 100644 --- a/app/Icons.js +++ b/app/Icons.js @@ -1,7 +1,6 @@ -import { Platform } from 'react-native'; import Ionicons from 'react-native-vector-icons/Ionicons'; +import { isIOS } from './utils/deviceInfo'; -const isIOS = Platform.OS === 'ios'; const prefix = isIOS ? 'ios' : 'md'; // icon name from provider: [ size of the uri, icon provider, name to be used later ] diff --git a/app/constants/headerOptions.js b/app/constants/headerOptions.js index a02384fc9..3516c6f0d 100644 --- a/app/constants/headerOptions.js +++ b/app/constants/headerOptions.js @@ -7,6 +7,7 @@ export const DARK_HEADER = { }, topBar: { backButton: { + showTitle: false, color: '#fff' }, background: { @@ -31,6 +32,7 @@ export const LIGHT_HEADER = { }, topBar: { backButton: { + showTitle: false, color: '#1d74f5' }, background: { diff --git a/app/containers/EmojiPicker/EmojiCategory.js b/app/containers/EmojiPicker/EmojiCategory.js index 19f2cf48a..3ea6c4018 100644 --- a/app/containers/EmojiPicker/EmojiCategory.js +++ b/app/containers/EmojiPicker/EmojiCategory.js @@ -1,14 +1,16 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Text, TouchableOpacity, Platform } from 'react-native'; +import { Text, TouchableOpacity } from 'react-native'; import { emojify } from 'react-emojione'; import { responsive } from 'react-native-responsive-ui'; import { OptimizedFlatList } from 'react-native-optimized-flatlist'; + import styles from './styles'; import CustomEmoji from './CustomEmoji'; import scrollPersistTaps from '../../utils/scrollPersistTaps'; +import { isIOS } from '../../utils/deviceInfo'; -const EMOJIS_PER_ROW = Platform.OS === 'ios' ? 8 : 9; +const EMOJIS_PER_ROW = isIOS ? 8 : 9; const renderEmoji = (emoji, size, baseUrl) => { if (emoji.isCustom) { diff --git a/app/containers/MessageBox/Recording.js b/app/containers/MessageBox/Recording.js index 8652f27a0..b7ae0f517 100644 --- a/app/containers/MessageBox/Recording.js +++ b/app/containers/MessageBox/Recording.js @@ -1,14 +1,15 @@ import React from 'react'; import PropTypes from 'prop-types'; import { - View, SafeAreaView, Platform, PermissionsAndroid, Text + View, SafeAreaView, PermissionsAndroid, Text } from 'react-native'; import { AudioRecorder, AudioUtils } from 'react-native-audio'; import { BorderlessButton } from 'react-native-gesture-handler'; - import Icon from 'react-native-vector-icons/MaterialIcons'; + import styles from './styles'; import I18n from '../../i18n'; +import { isIOS, isAndroid } from '../../utils/deviceInfo'; export const _formatTime = function(seconds) { let minutes = Math.floor(seconds / 60); @@ -20,7 +21,7 @@ export const _formatTime = function(seconds) { export default class extends React.PureComponent { static async permission() { - if (Platform.OS !== 'android') { + if (!isAndroid) { return true; } @@ -64,7 +65,7 @@ export default class extends React.PureComponent { }; // AudioRecorder.onFinished = (data) => { - if (!this.recordingCanceled && Platform.OS === 'ios') { + if (!this.recordingCanceled && isIOS) { this.finishRecording(data.status === 'OK', data.audioFileURL); } }; @@ -96,7 +97,7 @@ export default class extends React.PureComponent { try { this.recording = false; const filePath = await AudioRecorder.stopRecording(); - if (Platform.OS === 'android') { + if (isAndroid) { this.finishRecording(true, filePath); } } catch (err) { diff --git a/app/containers/MessageBox/UploadModal.js b/app/containers/MessageBox/UploadModal.js index 06417a0b8..3d04ba416 100644 --- a/app/containers/MessageBox/UploadModal.js +++ b/app/containers/MessageBox/UploadModal.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { - View, Text, StyleSheet, Image, ScrollView, Platform, TouchableHighlight + View, Text, StyleSheet, Image, ScrollView, TouchableHighlight } from 'react-native'; import PropTypes from 'prop-types'; import Modal from 'react-native-modal'; @@ -11,6 +11,7 @@ import TextInput from '../TextInput'; import Button from '../Button'; import I18n from '../../i18n'; import sharedStyles from '../../views/Styles'; +import { isIOS } from '../../utils/deviceInfo'; const cancelButtonColor = '#f7f8fa'; @@ -120,7 +121,7 @@ export default class UploadModal extends Component { renderButtons = () => { const { close } = this.props; - if (Platform.OS === 'ios') { + if (isIOS) { return (