Header transition presets with support for standard iOS transition style (#3526)

Header transition presets with approximate support for UIKit transition style
This commit is contained in:
Brent Vatne
2018-02-16 12:41:59 -08:00
committed by GitHub
parent 5febb81a1c
commit 3c3668c952
17 changed files with 573 additions and 84 deletions

View File

@@ -19,14 +19,12 @@ type MyNavScreenProps = {
class MyBackButton extends React.Component<any, any> {
render() {
return (
<Button onPress={this._navigateBack} title="Custom Back" />
);
return <Button onPress={this._navigateBack} title="Custom Back" />;
}
_navigateBack = () => {
this.props.navigation.goBack(null);
}
};
}
const MyBackButtonWithNavigation = withNavigation(MyBackButton);
@@ -108,7 +106,7 @@ type MyPhotosScreenProps = {
class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
static navigationOptions = {
title: 'Photos',
headerLeft: <MyBackButtonWithNavigation />
headerLeft: <MyBackButtonWithNavigation />,
};
_s0: NavigationEventSubscription;
_s1: NavigationEventSubscription;
@@ -180,18 +178,20 @@ MyProfileScreen.navigationOptions = props => {
};
};
const SimpleStack = StackNavigator({
Home: {
screen: MyHomeScreen,
},
Profile: {
path: 'people/:name',
screen: MyProfileScreen,
},
Photos: {
path: 'photos/:name',
screen: MyPhotosScreen,
},
});
const SimpleStack = StackNavigator(
{
Home: {
screen: MyHomeScreen,
},
Profile: {
path: 'people/:name',
screen: MyProfileScreen,
},
Photos: {
path: 'photos/:name',
screen: MyPhotosScreen,
},
}
);
export default SimpleStack;