react-native-safe-area
Advanced tools
Comparing version
@@ -86,4 +86,11 @@ // @flow | ||
get _injectedProps(): Props { | ||
const { top, bottom, left, right } = this.state.safeAreaInsets | ||
const isVerticalInverted = this.props.inverted && !this.props.horizontal | ||
const isHorizontalInverted = this.props.inverted && this.props.horizontal | ||
const { safeAreaInsets } = this.state | ||
const top = !isVerticalInverted ? safeAreaInsets.top : safeAreaInsets.bottom | ||
const bottom = !isVerticalInverted ? safeAreaInsets.bottom : safeAreaInsets.top | ||
const left = !isHorizontalInverted ? safeAreaInsets.left : safeAreaInsets.right | ||
const right = !isHorizontalInverted ? safeAreaInsets.right : safeAreaInsets.left | ||
if (applyTo === 'contentInset') { | ||
@@ -90,0 +97,0 @@ const contentInset = this.props.contentInset || {} |
{ | ||
"name": "react-native-safe-area", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "React Native module to get Safe Area Insets for iOS 11 or later", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
@@ -67,3 +67,3 @@ # react-native-safe-area | ||
```jsx | ||
const SafeAreaView = withSafeArea(View, 'margin', 'both') | ||
const SafeAreaView = withSafeArea(View, 'margin', 'all') | ||
@@ -70,0 +70,0 @@ class App extends Component<{}> { |
58779
0.82%259
2.37%