Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/containers/FileModal.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useState } from 'react';
import {
View, Text, TouchableWithoutFeedback, ActivityIndicator, StyleSheet, SafeAreaView
View, Text, TouchableWithoutFeedback, ActivityIndicator, StyleSheet
} from 'react-native';
import FastImage from 'react-native-fast-image';
import PropTypes from 'prop-types';
import Modal from 'react-native-modal';
import ImageViewer from 'react-native-image-zoom-viewer';
import SafeAreaView from 'react-native-safe-area-view';
import { Video } from 'expo-av';

import sharedStyles from '../views/Styles';
Expand Down
3 changes: 2 additions & 1 deletion app/containers/MessageBox/Recording.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
View, SafeAreaView, PermissionsAndroid, Text
View, PermissionsAndroid, Text
} from 'react-native';
import { AudioRecorder, AudioUtils } from 'react-native-audio';
import { BorderlessButton } from 'react-native-gesture-handler';
import SafeAreaView from 'react-native-safe-area-view';
import FileSystem from 'expo-file-system';

import styles from './styles';
Expand Down
3 changes: 2 additions & 1 deletion app/containers/ReactionsModal.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import {
View, Text, FlatList, StyleSheet, SafeAreaView
View, Text, FlatList, StyleSheet
} from 'react-native';
import PropTypes from 'prop-types';
import Modal from 'react-native-modal';
import Touchable from 'react-native-platform-touchable';
import SafeAreaView from 'react-native-safe-area-view';

import Emoji from './message/Emoji';
import I18n from '../i18n';
Expand Down
15 changes: 9 additions & 6 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Provider } from 'react-redux';
import { useScreens } from 'react-native-screens'; // eslint-disable-line import/no-unresolved
import { Linking } from 'react-native';
import PropTypes from 'prop-types';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import { appInit } from './actions';
import { deepLinkingOpen } from './actions/deepLinking';
Expand Down Expand Up @@ -314,12 +315,14 @@ export default class Root extends React.Component {
return (
<Provider store={store}>
<LayoutAnimation>
<App
ref={(navigatorRef) => {
Navigation.setTopLevelNavigator(navigatorRef);
}}
onNavigationStateChange={onNavigationStateChange}
/>
<SafeAreaProvider>
<App
ref={(navigatorRef) => {
Navigation.setTopLevelNavigator(navigatorRef);
}}
onNavigationStateChange={onNavigationStateChange}
/>
</SafeAreaProvider>
</LayoutAnimation>
</Provider>
);
Expand Down
21 changes: 4 additions & 17 deletions app/share.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from 'react';
import { View } from 'react-native';
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { Provider } from 'react-redux';
import RNUserDefaults from 'rn-user-defaults';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import Navigation from './lib/ShareNavigation';
import store from './lib/createStore';
import sharedStyles from './views/Styles';
import { isNotch, isIOS } from './utils/deviceInfo';
import { isIOS } from './utils/deviceInfo';
import { defaultHeader, onNavigationStateChange } from './utils/navigation';
import RocketChat from './lib/rocketchat';
import LayoutAnimation from './utils/layoutAnimation';
Expand Down Expand Up @@ -51,9 +50,6 @@ const AppContainer = createAppContainer(createSwitchNavigator({
class Root extends React.Component {
constructor(props) {
super(props);
this.state = {
isLandscape: false
};
this.init();
}

Expand All @@ -72,18 +68,9 @@ class Root extends React.Component {
}
}

handleLayout = (event) => {
const { width, height } = event.nativeEvent.layout;
this.setState({ isLandscape: width > height });
}

render() {
const { isLandscape } = this.state;
return (
<View
style={[sharedStyles.container, isLandscape && isNotch ? sharedStyles.notchLandscapeContainer : {}]}
onLayout={this.handleLayout}
>
<SafeAreaProvider>
<Provider store={store}>
<LayoutAnimation>
<AppContainer
Expand All @@ -94,7 +81,7 @@ class Root extends React.Component {
/>
</LayoutAnimation>
</Provider>
</View>
</SafeAreaProvider>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/AdminPanelView/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { WebView } from 'react-native-webview';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import { connect } from 'react-redux';

import I18n from '../../i18n';
Expand Down
3 changes: 2 additions & 1 deletion app/views/AutoTranslateView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
import {
FlatList, Switch, View, StyleSheet
} from 'react-native';
import { SafeAreaView, ScrollView } from 'react-navigation';
import { ScrollView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import RocketChat from '../../lib/rocketchat';
import I18n from '../../i18n';
Expand Down
2 changes: 1 addition & 1 deletion app/views/CreateChannelView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import {
View, Text, Switch, ScrollView, TextInput, StyleSheet, FlatList
} from 'react-native';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';

import Loading from '../containers/Loading';
Expand Down
2 changes: 1 addition & 1 deletion app/views/DirectoryView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
View, FlatList, Text
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import RocketChat from '../../lib/rocketchat';
import DirectoryItem from '../../presentation/DirectoryItem';
Expand Down
2 changes: 1 addition & 1 deletion app/views/ForgotPasswordView.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Text, ScrollView } from 'react-native';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import PropTypes from 'prop-types';

import KeyboardView from '../presentation/KeyboardView';
Expand Down
3 changes: 2 additions & 1 deletion app/views/LanguageView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import { FlatList } from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView, NavigationActions } from 'react-navigation';
import { NavigationActions } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import RocketChat from '../../lib/rocketchat';
import I18n from '../../i18n';
Expand Down
2 changes: 1 addition & 1 deletion app/views/LegalView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {
Text, ScrollView, View, StyleSheet
} from 'react-native';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import { RectButton } from 'react-native-gesture-handler';
import { connect } from 'react-redux';

Expand Down
2 changes: 1 addition & 1 deletion app/views/LoginSignupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from 'react-native';
import { connect } from 'react-redux';
import { Base64 } from 'js-base64';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import { RectButton, BorderlessButton } from 'react-native-gesture-handler';
import equal from 'deep-equal';

Expand Down
2 changes: 1 addition & 1 deletion app/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Keyboard, Text, ScrollView, View, StyleSheet, Alert
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';
import { analytics } from '../utils/log';

Expand Down
2 changes: 1 addition & 1 deletion app/views/MessagesView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { FlatList, View, Text } from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';
import ActionSheet from 'react-native-action-sheet';

Expand Down
2 changes: 1 addition & 1 deletion app/views/NewMessageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
View, StyleSheet, FlatList, Text
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';
import { orderBy } from 'lodash';
import { Q } from '@nozbe/watermelondb';
Expand Down
12 changes: 6 additions & 6 deletions app/views/NewServerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Text, ScrollView, Keyboard, Image, StyleSheet, TouchableOpacity, View, Alert
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import * as FileSystem from 'expo-file-system';
import DocumentPicker from 'react-native-document-picker';
import ActionSheet from 'react-native-action-sheet';
Expand Down Expand Up @@ -256,8 +256,8 @@ class NewServerView extends React.Component {
key='login-view'
>
<StatusBar light />
<ScrollView {...scrollPersistTaps} contentContainerStyle={sharedStyles.containerScrollView}>
<SafeAreaView style={sharedStyles.container} testID='new-server-view'>
<SafeAreaView style={sharedStyles.container} testID='new-server-view'>
<ScrollView {...scrollPersistTaps} contentContainerStyle={sharedStyles.containerScrollView}>
<Image style={styles.image} source={{ uri: 'new_server' }} />
<Text style={styles.title}>{I18n.t('Sign_in_your_server')}</Text>
<TextInput
Expand All @@ -279,9 +279,9 @@ class NewServerView extends React.Component {
loading={connecting}
testID='new-server-view-button'
/>
{ isIOS ? this.renderCertificatePicker() : null }
</SafeAreaView>
</ScrollView>
{isIOS ? this.renderCertificatePicker() : null}
</ScrollView>
</SafeAreaView>
{this.renderBack()}
</KeyboardView>
);
Expand Down
2 changes: 1 addition & 1 deletion app/views/NotificationPreferencesView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from 'react-native';
import PropTypes from 'prop-types';
import RNPickerSelect from 'react-native-picker-select';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import { SWITCH_TRACK_COLOR } from '../../constants/colors';
import StatusBar from '../../containers/StatusBar';
Expand Down
2 changes: 1 addition & 1 deletion app/views/OnboardingView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import Orientation from 'react-native-orientation-locker';

import { selectServerRequest, serverInitAdd, serverFinishAdd } from '../../actions/server';
Expand Down
2 changes: 1 addition & 1 deletion app/views/ProfileView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Dialog from 'react-native-dialog';
import SHA256 from 'js-sha256';
import ImagePicker from 'react-native-image-crop-picker';
import RNPickerSelect from 'react-native-picker-select';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';

import KeyboardView from '../../presentation/KeyboardView';
Expand Down
2 changes: 1 addition & 1 deletion app/views/ReadReceiptView/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FlatList, View, Text } from 'react-native';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';
import moment from 'moment';
import { connect } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion app/views/RegisterView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Keyboard, Text, ScrollView, Alert
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import RNPickerSelect from 'react-native-picker-select';
import equal from 'deep-equal';

Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomActionsView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
View, SectionList, Text, Alert, Share
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import { leaveRoom as leaveRoomAction } from '../../actions/room';
import styles from './styles';
Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomInfoEditView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Text, View, ScrollView, TouchableOpacity, Keyboard, Alert
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';

import database from '../../lib/database';
Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomInfoView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { View, Text, ScrollView } from 'react-native';
import { connect } from 'react-redux';
import moment from 'moment';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import Status from '../../containers/Status';
import Avatar from '../../containers/Avatar';
Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomMembersView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { FlatList, View, ActivityIndicator } from 'react-native';
import ActionSheet from 'react-native-action-sheet';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import * as Haptics from 'expo-haptics';
import { Q } from '@nozbe/watermelondb';

Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Text, View, InteractionManager } from 'react-native';
import { connect } from 'react-redux';
import { RectButton } from 'react-native-gesture-handler';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import { HeaderBackButton } from 'react-navigation-stack';
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
import moment from 'moment';
Expand Down
2 changes: 1 addition & 1 deletion app/views/RoomsListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'react-native';
import { connect } from 'react-redux';
import { isEqual, orderBy } from 'lodash';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import Orientation from 'react-native-orientation-locker';
import { Q } from '@nozbe/watermelondb';

Expand Down
2 changes: 1 addition & 1 deletion app/views/SearchMessagesView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { View, FlatList, Text } from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';

import RCTextInput from '../../containers/TextInput';
Expand Down
2 changes: 1 addition & 1 deletion app/views/SelectServerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';

import I18n from '../i18n';
import StatusBar from '../containers/StatusBar';
Expand Down
2 changes: 1 addition & 1 deletion app/views/SelectedUsersView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet, FlatList } from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import equal from 'deep-equal';
import { orderBy } from 'lodash';
import { Q } from '@nozbe/watermelondb';
Expand Down
2 changes: 1 addition & 1 deletion app/views/SetUsernameView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Text, ScrollView, StyleSheet
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import Orientation from 'react-native-orientation-locker';

import { loginRequest as loginRequestAction } from '../actions/login';
Expand Down
Loading