import * as React from 'react';
import { Button, View, Text } from 'react-native';
import {
createStackNavigator,
NavigationStackScreenComponent,
} from 'react-navigation-stack';
const ListScreen: NavigationStackScreenComponent = function (props) {
return (
List Screen
A list may go here
);
};
const ModalDialogScreen: NavigationStackScreenComponent = function (props) {
return (
Dialog
props.navigation.goBack()} />
);
};
export default createStackNavigator(
{
List: ListScreen,
ModalDialog: ModalDialogScreen,
},
{
initialRouteName: 'List',
mode: 'modal',
headerMode: 'none',
defaultNavigationOptions: {
cardStyle: { backgroundColor: 'transparent' },
gestureEnabled: false,
cardStyleInterpolator: ({ current: { progress } }) => {
const opacity = progress.interpolate({
inputRange: [0, 0.5, 0.9, 1],
outputRange: [0, 0.25, 0.7, 1],
});
return {
cardStyle: {
opacity,
},
};
},
},
}
);