import * as React from 'react'; import { Platform, ScrollView, StyleSheet, View } from 'react-native'; import { BlurView } from 'expo-blur'; import { getStatusBarHeight } from 'react-native-iphone-x-helper'; import { NavigationEventPayload, NavigationEventSubscription, Themed, SupportedThemes, } from 'react-navigation'; import { createStackNavigator, HeaderStyleInterpolators, NavigationStackScreenProps, NavigationStackProp, TransitionPresets, } from 'react-navigation-stack'; import { Button } from './Shared/ButtonWithMargin'; import { HeaderButtons } from './Shared/HeaderButtons'; import SampleText from './Shared/SampleText'; interface MyNavScreenProps { navigation: NavigationStackProp; banner: React.ReactNode; } class MyNavScreen extends React.Component { // Inset to compensate for navigation bar being transparent. // And improved abstraction for this will be built in to react-navigation // at some point. getHeaderInset(): any { const HEADER_HEIGHT = getStatusBarHeight() + Platform.select({ ios: 44, default: 56 }); return Platform.select({ android: { contentContainerStyle: { paddingTop: HEADER_HEIGHT, }, }, ios: { contentInset: { top: HEADER_HEIGHT }, contentOffset: { y: -HEADER_HEIGHT }, }, }); } render() { const { navigation, banner } = this.props; const { push, replace, popToTop, pop } = navigation; return ( {banner}