fix: remove top margin from screen in native stack on Android

In newer versions of react-native-screens, the content is no longer below the header, so the top margin in not needed anymore.
This commit is contained in:
satyajit.happy
2019-11-02 02:56:46 +01:00
parent c55d4511ff
commit 5cd69401ec

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import { View, StyleSheet, Platform } from 'react-native';
import { View, StyleSheet } from 'react-native';
import { StackNavigationState, StackActions } from '@react-navigation/routers';
import {
@@ -43,20 +43,7 @@ export default function StackView({ state, navigation, descriptors }: Props) {
}}
>
<HeaderConfig {...options} route={route} />
<View
style={[
styles.content,
{
marginTop:
Platform.OS === 'android' && options.headerShown !== false
? 56
: 0,
},
contentStyle,
]}
>
{renderScene()}
</View>
<View style={[styles.content, contentStyle]}>{renderScene()}</View>
</Screen>
);
})}