diff --git a/docs/pages/5.react-native-web.md b/docs/pages/5.react-native-web.md index d247d305dc..5ba30bf033 100644 --- a/docs/pages/5.react-native-web.md +++ b/docs/pages/5.react-native-web.md @@ -30,7 +30,7 @@ yarn add --dev react-app-rewired module.exports = function override(config, env) { config.module.rules.push({ test: /\.js$/, - exclude: /node_modules[/\\](?!react-native-vector-icons|react-native-safe-area-view)/, + exclude: /node_modules[/\\](?!react-native-vector-icons)/, use: { loader: "babel-loader", options: { @@ -176,7 +176,7 @@ Now, add the following in the `module.rules` array in your webpack config: ```js { test: /\.js$/, - exclude: /node_modules[/\\](?!react-native-vector-icons|react-native-safe-area-view)/, + exclude: /node_modules[/\\](?!react-native-vector-icons)/, use: { loader: 'babel-loader', options: { diff --git a/package.json b/package.json index 85a4bdf0a9..2cc89c4b9c 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "dependencies": { "@callstack/react-theme-provider": "^3.0.5", "color": "^3.1.2", - "react-native-safe-area-view": "^0.14.9" + "react-native-iphone-x-helper": "^1.3.1" }, "devDependencies": { "@babel/core": "^7.10.3", diff --git a/src/components/BottomNavigation.tsx b/src/components/BottomNavigation.tsx index 0d8630a8e8..e0d0cf57cb 100644 --- a/src/components/BottomNavigation.tsx +++ b/src/components/BottomNavigation.tsx @@ -13,7 +13,7 @@ import { ViewStyle, LayoutChangeEvent, } from 'react-native'; -import SafeAreaView from 'react-native-safe-area-view'; +import { getBottomSpace } from 'react-native-iphone-x-helper'; import color from 'color'; import overlay from '../styles/overlay'; import Icon, { IconSource } from './Icon'; @@ -271,6 +271,7 @@ const MIN_RIPPLE_SCALE = 0.001; // Minimum scale is not 0 due to bug with animat const MIN_TAB_WIDTH = 96; const MAX_TAB_WIDTH = 168; const BAR_HEIGHT = 56; +const BOTTOM_INSET = getBottomSpace(); const FAR_FAR_AWAY = Platform.OS === 'web' ? 0 : 9999; const Touchable = ({ @@ -784,9 +785,11 @@ class BottomNavigation extends React.Component { onLayout={this.handleLayout} > - {shifting ? ( { ), }); })} - + diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 0b314c7b22..d00e451cee 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -7,8 +7,12 @@ import { StyleSheet, TouchableWithoutFeedback, ViewStyle, + View, } from 'react-native'; -import SafeAreaView from 'react-native-safe-area-view'; +import { + getStatusBarHeight, + getBottomSpace, +} from 'react-native-iphone-x-helper'; import Surface from './Surface'; import { withTheme } from '../core/theming'; @@ -49,6 +53,8 @@ type State = { }; const DEFAULT_DURATION = 220; +const TOP_INSET = getStatusBarHeight(true); +const BOTTOM_INSET = getBottomSpace(); /** * The Modal component is a simple way to present content above an enclosing view. @@ -89,7 +95,6 @@ const DEFAULT_DURATION = 220; * export default MyComponent; * ``` */ - class Modal extends React.Component { static defaultProps = { dismissable: true, @@ -212,7 +217,13 @@ class Modal extends React.Component { ]} /> - + { > {children} - + ); } diff --git a/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap b/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap index 478be8c066..686f0f5986 100644 --- a/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap +++ b/src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap @@ -89,19 +89,17 @@ exports[`hides labels in non-shifting bottom navigation 1`] = ` } >