Commit 1c22cc2f authored by Djorkaeff Alexandre's avatar Djorkaeff Alexandre Committed by Diego Mello
Browse files

[CHORE] Update react-native-safe-area-view (#1219)

parent 11249f96
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';
......
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';
......
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';
......
......@@ -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';
......@@ -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>
);
......
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';
......@@ -51,9 +50,6 @@ const AppContainer = createAppContainer(createSwitchNavigator({
class Root extends React.Component {
constructor(props) {
super(props);
this.state = {
isLandscape: false
};
this.init();
}
......@@ -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
......@@ -94,7 +81,7 @@ class Root extends React.Component {
/>
</LayoutAnimation>
</Provider>
</View>
</SafeAreaProvider>
);
}
}
......
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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......@@ -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
......@@ -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>
);
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
import React from 'react';
import {
View, Linking, ScrollView, AsyncStorage, SafeAreaView, Switch, Text, Share
View, Linking, ScrollView, AsyncStorage, Switch, Text, Share
} from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import SafeAreaView from 'react-native-safe-area-view';
import { toggleMarkdown as toggleMarkdownAction } from '../../actions/markdown';
import { toggleCrashReport as toggleCrashReportAction } from '../../actions/crashReport';
......
......@@ -3,13 +3,13 @@ import PropTypes from 'prop-types';
import {
View, Text, FlatList, ActivityIndicator, Keyboard, BackHandler
} from 'react-native';
import { SafeAreaView } from 'react-navigation';
import ShareExtension from 'rn-extensions-share';
import { connect } from 'react-redux';
import RNFetchBlob from 'rn-fetch-blob';
import * as mime from 'react-native-mime-types';
import { isEqual, orderBy } from 'lodash';
import { Q } from '@nozbe/watermelondb';
import SafeAreaView from 'react-native-safe-area-view';
import Navigation from '../../lib/ShareNavigation';
import database from '../../lib/database';
......
......@@ -5,6 +5,7 @@ import {
} from 'react-native';
import { connect } from 'react-redux';
import ShareExtension from 'rn-extensions-share';
import SafeAreaView from 'react-native-safe-area-view';
import {
COLOR_TEXT_DESCRIPTION
......@@ -225,7 +226,7 @@ class ShareView extends React.Component {
}
return (
<View style={styles.container}>
<SafeAreaView style={styles.container} forceInset={{ vertical: 'never' }}>
<View style={isMedia ? styles.toContent : styles.toContentText}>
<Text style={styles.text} numberOfLines={1}>
<Text style={styles.to}>{`${ I18n.t('To') }: `}</Text>
......@@ -236,7 +237,7 @@ class ShareView extends React.Component {
{isMedia ? this.renderMediaContent() : this.renderInput()}
</View>
{ loading ? <Loading /> : null }
</View>
</SafeAreaView>
);
}
}
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
ScrollView, Text, View, FlatList, SafeAreaView
ScrollView, Text, View, FlatList
} from 'react-native';
import { connect } from 'react-redux';
import equal from 'deep-equal';
import { RectButton } from 'react-native-gesture-handler';
import SafeAreaView from 'react-native-safe-area-view';
import { Q } from '@nozbe/watermelondb';
import { logout as logoutAction } from '../../actions/login';
......
......@@ -4,7 +4,7 @@ import {
FlatList, View, Text, InteractionManager
} from 'react-native';
import { connect } from 'react-redux';
import { SafeAreaView } from 'react-navigation';
import SafeAreaView from 'react-native-safe-area-view';
import moment from 'moment';
import orderBy from 'lodash/orderBy';
import { Q } from '@nozbe/watermelondb';
......
......@@ -293,6 +293,8 @@ PODS:
- React
- react-native-orientation-locker (1.1.6):
- React
- react-native-safe-area-context (0.3.6):
- React
- react-native-splash-screen (3.2.0):
- React
- react-native-video (5.0.0):
......@@ -431,6 +433,7 @@ DEPENDENCIES:
- react-native-keyboard-tracking-view (from `../node_modules/react-native-keyboard-tracking-view`)
- react-native-notifications (from `../node_modules/react-native-notifications`)
- react-native-orientation-locker (from `../node_modules/react-native-orientation-locker`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- react-native-video (from `../node_modules/react-native-video`)
- react-native-webview (from `../node_modules/react-native-webview`)
......@@ -560,6 +563,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-notifications"
react-native-orientation-locker:
:path: "../node_modules/react-native-orientation-locker"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-splash-screen:
:path: "../node_modules/react-native-splash-screen"
react-native-video:
......@@ -697,6 +702,7 @@ SPEC CHECKSUMS:
react-native-keyboard-tracking-view: 1ebd24a2b6ca2314549aa51775995678094bffa1
react-native-notifications: 163ddedac6fcc8d850ea15b06abdadcacdff00f1
react-native-orientation-locker: 23918c400376a7043e752c639c122fcf6bce8f1c
react-native-safe-area-context: e380a6f783ccaec848e2f3cc8eb205a62362950d
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
react-native-video: 6555881252c8ca039760e1cd6df28ac28ffb2baf
react-native-webview: 9f588ea09ede9bd1f5443f4aa4ddfadeb51fcd28
......
../../../../../node_modules/react-native-safe-area-context/ios/SafeAreaView/RNCSafeAreaView.h
\ No newline at end of file
../../../../../node_modules/react-native-safe-area-context/ios/SafeAreaView/RNCSafeAreaViewManager.h
\ No newline at end of file
../../../../../node_modules/react-native-safe-area-context/ios/SafeAreaView/RNCSafeAreaView.h
\ No newline at end of file
../../../../../node_modules/react-native-safe-area-context/ios/SafeAreaView/RNCSafeAreaViewManager.h
\ No newline at end of file
{
"name": "react-native-safe-area-context",
"version": "0.3.6",
"summary": "A flexible way to handle safe area, also works on Android and web.",
"license": "MIT",
"authors": "Janic Duplessis <janicduplessis@gmail.com>",
"homepage": "https://github.com/th3rdwave/react-native-safe-area-context#readme",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/th3rdwave/react-native-safe-area-context.git",
"tag": "v0.3.6"
},
"source_files": "ios/**/*.{h,m}",
"dependencies": {
"React": [
]
}
}
......@@ -293,6 +293,8 @@ PODS:
- React
- react-native-orientation-locker (1.1.6):
- React
- react-native-safe-area-context (0.3.6):
- React
- react-native-splash-screen (3.2.0):
- React
- react-native-video (5.0.0):
......@@ -431,6 +433,7 @@ DEPENDENCIES: